-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Incorrect description of std::prelude name resolution in standard library docs #64686
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
The documentation for
std::preludestates:But I believe the second part of that is no longer a correct description of how the prelude works, as far as user-visible behaviour is concerned.
In particular, the following code compiles, but doesn't if I remove the
usestatement:And the following doesn't compile (saying «
Stringis ambiguous»), but does if I remove theusefor the prelude:(Looking in libsyntax_ext/standard_library_imports.rs, I think it is still literally true that the compiler inserts a fake
usedirective, but the resolver treats it entirely differently to a normal one, so this doesn't seem to be something it makes sense to document.)