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

rustdoc: notable traits triggers on all &[T] and &mut [T] returns #100322

Closed
jsha opened this issue Aug 9, 2022 · 0 comments · Fixed by #108954
Closed

rustdoc: notable traits triggers on all &[T] and &mut [T] returns #100322

jsha opened this issue Aug 9, 2022 · 0 comments · Fixed by #108954
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jsha
Copy link
Contributor

jsha commented Aug 9, 2022

All methods and functions that return &[T] get the ⓘ Notable Traits icon indicating the return type has some trait that the reader should know about immediately. For instance:

https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.as_slice

image

This shouldn't happen for two reasons:

  • for generic T there's no reason to believe T will be u8, and implying to the user that it will be u8 is just confusing.
  • even when T is u8, the Read and Write impls are far from the most notable thing about &[u8] and &mut [u8]. Rather than attaching a ⓘ to every instance of -> &[u8] and -> &mut [u8] in the documentation, we should rely on the slice page to communicate those impls.

Related: #100320, #55082

@jsha jsha added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: rustdoc UI (generated HTML) labels Aug 10, 2022
@bors bors closed this as completed in 0392e29 Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: rustdoc UI (generated HTML) 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.

1 participant