-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add note regarding parent module containing use statement. #42283
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
Conversation
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc_resolve/diagnostics.rs
Outdated
`use super::File;` which will import the types from the parent namespace. An | ||
example that causes this error is below: | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be ```ignore
|
||
mod foo { | ||
// either | ||
use super::File; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently CI failed with
[00:55:49] ---- /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index (line 6486) stdout ----
[00:55:49] error[E0432]: unresolved import `super::File`
[00:55:49] --> <anon>:6:9
[00:55:49] |
[00:55:49] 6 | use super::File;
[00:55:49] | ^^^^^^^^^^^ no `File` in the root
Dunno why, probably workaround it by adding a hidden # pub
above the use std::fs::File
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem here was that rustdoc auto-injects fn main
surrounding this, so it was correct -- there was no File
in root. I inserted an empty commented fn main to workaround this, so we should be fine now.
b9d7fb3
to
c85a8fb
Compare
@bors r+ rollup |
📌 Commit c85a8fb has been approved by |
Add note regarding parent module containing use statement. Fixes #40341.
☀️ Test successful - status-appveyor, status-travis |
Fixes #40341.