Given this code (playground):
use tokio::sync::mpsc;
fn main() {
let (tx, rx) = mpsc::channel::new(1);
}
I expected that rustc would indicate that new() is not function but channel(1) is. Instead, I got:
Compiling playground v0.0.1 (/playground)
error[E0433]: failed to resolve: could not find `channel` in `mpsc`
--> src/main.rs:4:26
|
4 | let (tx, rx) = mpsc::channel::new(1);
| ^^^^^^^ could not find `channel` in `mpsc`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.
error: could not compile `playground`.
To learn more, run the command again with --verbose.
A diagnostic along the lines of new(..) isn't a function, but channel(..) is would be helpful.
Meta
rustc --version --verbose:
❯ rustc --version --verbose
rustc 1.42.0 (b8cedc004 2020-03-09)
binary: rustc
commit-hash: b8cedc00407a4c56a3bda1ed605c6fc166655447
commit-date: 2020-03-09
host: x86_64-apple-darwin
release: 1.42.0
LLVM version: 9.0
Given this code (playground):
I expected that
rustcwould indicate thatnew()is not function butchannel(1)is. Instead, I got:A diagnostic along the lines of
new(..)isn't a function, butchannel(..)is would be helpful.Meta
rustc --version --verbose: