Skip to content

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

Merged
merged 1 commit into from
May 30, 2017

Conversation

Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum commented May 28, 2017

Fixes #40341.

@rust-highfive
Copy link
Contributor

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

`use super::File;` which will import the types from the parent namespace. An
example that causes this error is below:

```
Copy link
Member

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;
Copy link
Member

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?

Copy link
Member Author

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.

@carols10cents carols10cents added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 29, 2017
@pnkfelix
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 29, 2017

📌 Commit c85a8fb has been approved by pnkfelix

@bors
Copy link
Collaborator

bors commented May 30, 2017

⌛ Testing commit c85a8fb with merge e1fe1a8...

bors added a commit that referenced this pull request May 30, 2017
Add note regarding parent module containing use statement.

Fixes #40341.
@bors
Copy link
Collaborator

bors commented May 30, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: pnkfelix
Pushing e1fe1a8 to master...

@bors bors merged commit c85a8fb into rust-lang:master May 30, 2017
@Mark-Simulacrum Mark-Simulacrum deleted the issue-40341 branch June 8, 2019 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants