-
Notifications
You must be signed in to change notification settings - Fork 13.3k
use
-ing an item from the current module causes unresolved use errors.
#8640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Triage: this appears to be a problem with directly re-importing an from the current module, e.g. mod foo {
use foo::bar;
mod bar {}
}
fn main() {} gives the same error pointing at |
(For comparison, importing something with the same name from a different module is ok: #[allow(unused_imports)];
mod foo {
use baz::bar;
mod bar {}
}
mod baz { pub mod bar {} }
fn main() {} compiles without a problem.) |
Still an issue.
Gives
Works. (Updated attribute syntax) |
This doesn't add a test for the main problem in rust-lang#8640 since it seems that was already fixed (including a test) in PR rust-lang#19522. This just adds a test for a program mentioned in the comments that used to erroneously compile. Closes rust-lang#8640.
Something like this should really produce a better error message:
Not sure whether current compiler state makes it difficult to identify this and other reasons for failed resolution, but if it's fairly simple better error messages would be great.
The text was updated successfully, but these errors were encountered: