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

add docs for references as a primitive #43560

Merged
merged 1 commit into from
Aug 1, 2017

Conversation

QuietMisdreavus
Copy link
Member

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

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

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

@GuillaumeGomez
Copy link
Member

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?

@QuietMisdreavus
Copy link
Member Author

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

@QuietMisdreavus
Copy link
Member Author

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.

@alexcrichton
Copy link
Member

r? @steveklabnik

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

Seems good to me. Will just wait someone else's confirmation.

@steveklabnik
Copy link
Member

@bors: r+

looks great to me too, thanks!

@carols10cents
Copy link
Member

@bors r=steveklabnik

@bors
Copy link
Contributor

bors commented Jul 31, 2017

📌 Commit a2d5514 has been approved by steveklabnik

@bors
Copy link
Contributor

bors commented Aug 1, 2017

⌛ Testing commit a2d5514 with merge 0bf018c...

bors added a commit that referenced this pull request Aug 1, 2017
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
@bors
Copy link
Contributor

bors commented Aug 1, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: steveklabnik
Pushing 0bf018c to master...

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.

References have no primitive page in rustdoc
7 participants