Skip to content

Specialized trait impls appear unannotated in the docs #87545

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

Open
Nemo157 opened this issue Jul 28, 2021 · 2 comments
Open

Specialized trait impls appear unannotated in the docs #87545

Nemo157 opened this issue Jul 28, 2021 · 2 comments
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Nemo157
Copy link
Member

Nemo157 commented Jul 28, 2021

Looking at the docs for ToString it shows that there's an implementation for char

impl ToString for char

but, this overlaps the blanket impl + char's Display impl:

impl<T> ToString for T where T: Display + ?Sized
impl Display for char

Showing this specialization-based implementation in the docs with no indication of why the overlap is allowed is confusing.

Since specialization is supposed to be generally invisible to the user, maybe we shouldn't be showing specialized impls at all.

@Nemo157 Nemo157 added C-bug Category: This is a bug. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Jul 28, 2021
@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jul 28, 2021
@the8472
Copy link
Member

the8472 commented Jul 28, 2021

The libs dev guide already recommends to hide specializations in private traits, that would also help this case.

https://std-dev-guide.rust-lang.org/code-considerations/using-unstable-lang/specialization.html

@steffahn
Copy link
Member

Any reason not to simply add #[doc(hidden)] on all the specialized impls for now?

steffahn added a commit to steffahn/rust that referenced this issue Jul 24, 2023
The status quo is highly confusing, since the overlap is not apparent,
and specialization is not a feature of Rust. This addresses rust-lang#87545;
I'm not certain if it closes it, since that issue might also be trackign
a *general* solution for hiding specializing impls automatically.
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 25, 2023
…mpls, r=thomcc

Hide `ToString` implementations that specialize the default one

The status quo is highly confusing, since the overlap is not apparent, and specialization is not a feature of Rust. This change addresses rust-lang#87545; I'm not certain if it closes/fixes it entirely, since that issue might also be tracking the question of a *general* solution for hiding the documentation for specializing impls automatically.

Before
![Screenshot_20230724_234210](https://github.com/rust-lang/rust/assets/3986214/54bbe659-1790-4e95-a5d8-5426e710ceb8)

After
![Screenshot_20230724_234255](https://github.com/rust-lang/rust/assets/3986214/ee645d6e-c1c0-40c0-a0d3-a5c5f3dae65e)
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) C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants