-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
the name std is defined multiple times #59243
Copy link
Copy link
Closed
Labels
A-metadataArea: Crate metadataArea: Crate metadataA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specifically
Description
Activity
Metadata
Metadata
Assignees
Labels
A-metadataArea: Crate metadataArea: Crate metadataA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specifically
The error happens on latest stable and nightly.
Steps to reproduce:
cargo new --lib lib1;src/lib.rs:tests/test1.rs:cargo testreturns error:The error only happens if the module is named
std(for instance,coreandallocwork without error). The error is not produced iftest1.rsdoesn't uselib1in any way. Iftest1.rsdoesn't contain imports but uses the library directly (e.g.::lib1::x()), the error is produced.cargo buildalways succeeds.I don't know if this is supposed to be forbidden but the error message seems to be misleading.