Skip to content
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

Document underscore imports. #492

Merged
merged 2 commits into from
Dec 30, 2018
Merged

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Dec 30, 2018

Closes #470.

This includes a semi-unrelated change to use documentation to clarify some changes regarding use cratename. I'm not super comfortable with these changes, but I don't see anything obviously wrong.

Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good.

useful for crates that only need to be linked, but are never referenced, and
will avoid being reported as unused.

The `#[macro_use]` attribute will work as usual and import the macro names
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there somewhere to hyperlink "as usual" to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. I added a link to where macro_use is described, but it is very brief. I actually just today learned about the macro-use prelude, and I'm not sure if it is wise to mention it here since it is not described anywhere.

In general I think it would be amazing to have good documentation on name resolution — something that explained the different namespaces, the different preludes, the precedence and order, macro resolution, maybe ribs?, etc. I added docs on "extern prelude", but I don't really understand these things. I think if I did understand them, my mental model of how Rust works would be substantially improved. I'm not even sure where to start learning it (is everything in librustc_resolve? and macros are mostly in libsyntax?). The current rustc-guide docs are kinda incomplete.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should have a Q&A session with @petrochenkov... =P

src/items/use-declarations.md Show resolved Hide resolved
@Centril
Copy link
Contributor

Centril commented Dec 30, 2018

Looks good; Let's :shipit:

@Centril Centril merged commit aa6f004 into rust-lang:master Dec 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants