-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Comments
cc #15318 |
What sorts of impls would be expected on this page? Listing impls for every |
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. |
At least inherent methods should be listed now. |
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
Triage: no change |
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? 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. |
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
E.g. there's no http://doc.rust-lang.org/master/std/uint/primitive.uint.html for
&
or&mut
.The text was updated successfully, but these errors were encountered: