Closed
Description
For example (playground):
const _: () = ();
fn main() {
a
}
Errors with:
error[E0425]: cannot find value `a` in this scope
--> src/main.rs:4:5
|
1 | const _: () = ();
| ----------------- similarly named constant `_` defined here
...
4 | a
| ^ help: a constant with a similar name exists: `_`
The same also happens with use Trait as _
(playground):
pub use Iterator as _;
fn foo<T: A>(x: T) {}
error[E0405]: cannot find trait `A` in this scope
--> src/lib.rs:3:11
|
3 | fn foo<T: A>(x: T) {}
| ^ help: a trait with a similar name exists: `_`
The diagnostics shouldn't suggest things named underscore.