-
Notifications
You must be signed in to change notification settings - Fork 527
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
Conversation
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.
Looks mostly good.
src/items/extern-crates.md
Outdated
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 |
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.
Is there somewhere to hyperlink "as usual" to?
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.
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.
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.
You should have a Q&A session with @petrochenkov... =P
Looks good; Let's |
Closes #470.
This includes a semi-unrelated change to
use
documentation to clarify some changes regardinguse cratename
. I'm not super comfortable with these changes, but I don't see anything obviously wrong.