You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mattheww opened this issue
Sep 22, 2019
· 1 comment
· Fixed by #73484
Labels
A-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsA-resolveArea: Name resolutionC-bugCategory: This is a bug.T-langRelevant to the language team, which will review and decide on the PR/issue.
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 use statement:
mod foo {
use std::prelude::v1::*;
type Bar = self::String;
}
And the following doesn't compile (saying «String is ambiguous»), but does if I remove the use for the prelude:
mod foo {
use std::prelude::v1::*;
use bar::*;
mod bar {
pub struct String {}
}
type Baz = String;
}
(Looking in libsyntax_ext/standard_library_imports.rs, I think it is still literally true that the compiler inserts a fake use directive, but the resolver treats it entirelydifferently to a normal one, so this doesn't seem to be something it makes sense to document.)
The text was updated successfully, but these errors were encountered:
jonas-schievink
added
A-resolve
Area: Name resolution
C-bug
Category: This is a bug.
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
labels
Sep 22, 2019
A-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsA-resolveArea: Name resolutionC-bugCategory: This is a bug.T-langRelevant to the language team, which will review and decide on the PR/issue.
The documentation for
std::prelude
states: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
use
statement:And the following doesn't compile (saying «
String
is ambiguous»), but does if I remove theuse
for the prelude:(Looking in libsyntax_ext/standard_library_imports.rs, I think it is still literally true that the compiler inserts a fake
use
directive, but the resolver treats it entirely differently to a normal one, so this doesn't seem to be something it makes sense to document.)The text was updated successfully, but these errors were encountered: