-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
add docs for references as a primitive #43560
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
I have difficulties to understand just from reading the code what the output looks like. Can you provide us a screenshot with the new result please? |
Even better, i'll link you the rendering i used to test out the rustdoc changes: https://tonberry.quietmisdreavus.net/std-15654/std/primitive.reference.html |
Another thing to note, whether this or #43529 lands first, the other will need to rebase on top of it, since they both modify the same things. |
Seems good to me. Will just wait someone else's confirmation. |
@bors: r+ looks great to me too, thanks! |
@bors r=steveklabnik |
📌 Commit a2d5514 has been approved by |
add docs for references as a primitive Just like #43529 did for function pointers, here is a new primitive page for references. This PR will pull in impls on references if it's a reference to a generic type parameter. Initially i was only able to pull in impls that were re-exported from another crate; crate-local impls got a different representation in the AST, and i had to change how types were resolved when cleaning it. (This is the change at the bottom of `librustdoc/clean/mod.rs`, in `resolve_type`.) I'm unsure the full ramifications of the change, but from what it looks like, it shouldn't impact anything major. Likewise, references to generic type parameters also get the `&'a [mut]` linked to the new page. cc @rust-lang/docs: Is this sufficient information? The listing of trait impls kinda feels redundant (especially if we can get the automated impl listing sorted again), but i still think it's useful to point out that you can use these in a generic context. Fixes #15654
☀️ Test successful - status-appveyor, status-travis |
Just like #43529 did for function pointers, here is a new primitive page for references.
This PR will pull in impls on references if it's a reference to a generic type parameter. Initially i was only able to pull in impls that were re-exported from another crate; crate-local impls got a different representation in the AST, and i had to change how types were resolved when cleaning it. (This is the change at the bottom of
librustdoc/clean/mod.rs
, inresolve_type
.) I'm unsure the full ramifications of the change, but from what it looks like, it shouldn't impact anything major. Likewise, references to generic type parameters also get the&'a [mut]
linked to the new page.cc @rust-lang/docs: Is this sufficient information? The listing of trait impls kinda feels redundant (especially if we can get the automated impl listing sorted again), but i still think it's useful to point out that you can use these in a generic context.
Fixes #15654