Closed
Description
mod serde {}
use serde::foo;
Errors:
Compiling playground v0.0.1 (/playground)
error[E0432]: unresolved import `serde::foo`
--> src/lib.rs:3:5
|
3 | use serde::foo;
| ^^^^^^^^^^ no `foo` in `serde`
error[E0659]: `serde` is ambiguous (name vs any other name during import resolution)
--> src/lib.rs:3:5
|
3 | use serde::foo;
| ^^^^^ ambiguous name
|
= note: `serde` could refer to a crate passed with `--extern`
= help: use `::serde` to refer to this crate unambiguously
note: `serde` could also refer to the module defined here
--> src/lib.rs:1:1
|
1 | mod serde {}
| ^^^^^^^^^^^^
= help: use `crate::serde` to refer to this module unambiguously
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0432, E0659.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `playground`
To learn more, run the command again with --verbose.
The error message says:
serde
is ambiguous (name vs any other name during import resolution)
But what does it mean by "name vs any other name during import resolution"? I think this should be reworded or even deleted – it doesn't seem to add anything.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Name/path resolution done by `rustc_resolve` specificallyCategory: An issue proposing an enhancement or a PR with one.Diagnostics: Confusing error or lint that should be reworked.Relevant to the compiler team, which will review and decide on the PR/issue.