Skip to content

rustdoc: Many times the same From<!> for T impl for the ! type #96036

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

Closed
poliorcetics opened this issue Apr 14, 2022 · 3 comments · Fixed by #96091
Closed

rustdoc: Many times the same From<!> for T impl for the ! type #96036

poliorcetics opened this issue Apr 14, 2022 · 3 comments · Fixed by #96091
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@poliorcetics
Copy link
Contributor

https://doc.rust-lang.org/nightly/std/primitive.never.html#blanket-implementations

image

All pointing to the same impl:

image

@rustbot label +T-rustdoc

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Apr 14, 2022
@fmease
Copy link
Member

fmease commented Apr 15, 2022

Actually, the never type !, the trait From and #[rustc_reservation_impl] are not needed: It occurs with any type and any parameterized trait.
Minimal reproducible example:

#![crate_type = "lib"]

impl<T> Something<Whatever> for T { }    // blanket impl is duplicated on Whatever's page
pub struct Whatever { /* whatever */ }

pub trait Something<T> { }

The number of duplicates depends on the number of public types accessible in the target crate.

@GuillaumeGomez
Copy link
Member

Taking a look.

@GuillaumeGomez
Copy link
Member

@fmease's code:

pub trait Something<T> { }
pub struct Whatever;
impl<T> Something<Whatever> for T {}

Gives:

Screenshot from 2022-04-15 17-31-27

notriddle added a commit to notriddle/rust that referenced this issue Apr 15, 2022
Fixes rust-lang#96036

This is a different approach than rust-lang#96091, an approach that should have less
performance impact.
@bors bors closed this as completed in ad4e98e Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
4 participants