Document underscore imports.#492
Conversation
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.
Is there somewhere to hyperlink "as usual" to?
There was a problem hiding this comment.
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.
You should have a Q&A session with @petrochenkov... =P
|
Looks good; Let's |
Closes #470.
This includes a semi-unrelated change to
usedocumentation to clarify some changes regardinguse cratename. I'm not super comfortable with these changes, but I don't see anything obviously wrong.