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

References have no primitive page in rustdoc #15654

Closed
huonw opened this issue Jul 14, 2014 · 6 comments · Fixed by #43560
Closed

References have no primitive page in rustdoc #15654

huonw opened this issue Jul 14, 2014 · 6 comments · Fixed by #43560
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@huonw
Copy link
Member

huonw commented Jul 14, 2014

E.g. there's no http://doc.rust-lang.org/master/std/uint/primitive.uint.html for & or &mut.

@huonw
Copy link
Member Author

huonw commented Jul 19, 2014

cc #15318

@steveklabnik steveklabnik added A-docs T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 14, 2015
@tomjakubowski
Copy link
Contributor

What sorts of impls would be expected on this page? Listing impls for every clean::BorrowedRef (<T> &T, <T> &Vec<T>, &str, <T> &[T], &Foo) might be excessive, although of course it's better to err on the side of documenting too much than not enough :-)

@steveklabnik
Copy link
Member

It might be, yeah. In principle, there should at least be some kind of page I can put some text on, even if it says "Most of the methods aren't shown on this page because it's too primitive" or something.

@nagisa
Copy link
Member

nagisa commented Apr 5, 2015

At least inherent methods should be listed now.

birkenfeld added a commit to birkenfeld/rust that referenced this issue May 9, 2016
While it is not useful to list impls here, and there are no inherent methods,
references are still a primitive (and very important) type and should get an
entry in the overview on http://doc.rust-lang.org/std/#primitives and a place
to put general verbiage about references, and probably a reference to the book.

We do *not* add links to this page from other types, like we do for `&[T]`,
because that would likely be more confusing than helpful.

Fixes: rust-lang#15654
@steveklabnik
Copy link
Member

Triage: no change

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-feature-request Category: A feature request, i.e: not implemented / a PR. label Jul 21, 2017
@QuietMisdreavus
Copy link
Member

Since i just did function pointers (#43529), i'll add this while the details are fresh in mind.

@rust-lang/docs: What details should go here? &T: Copy? Using &* for reborrowing and Deref? Copy/paste details from either edition of the book? Leave it as a skeleton and fill it out later?

As for what impls to include, my initial thought was to only include impls where it's a reference to a generic. Otherwise it'll show up on the referent's page, like it is now.

bors added a commit that referenced this issue 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants