-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Open
Labels
A-auto-traitsArea: auto traits (e.g., `auto trait Send {}`)Area: auto traits (e.g., `auto trait Send {}`)A-synthetic-implsArea: Synthetic impls, used by rustdoc to document auto traits and traits with blanket implsArea: Synthetic impls, used by rustdoc to document auto traits and traits with blanket implsC-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
Given
pub struct Outer<T>(Inner<T>);
struct Inner<T>(T);
// non-identity impl:
impl Unpin for Inner<()> {} // or any other auto trait
rustdoc currently synthesizes:
impl<T> !Unpin for Outer<T>
However, ideally it would be:
impl Unpin for Outer<()>
Counterexample:
pub struct Outer<T>(Inner<T, i32>, Inner<T, u32>);
struct Inner<T, D>(T, D);
impl Unpin for Inner<(), i32> {}
impl Unpin for Inner<bool, u32> {}
Here, the synthesized impl<T> !Unpin for Outer<T>
is obviously correct (modulo #146571).
Side note: This only affects non-identity impls (i.e., args differ from impl'er's def) and not conditional impls (i.e., bounds diff from impl'er's def) because the latter is forbidden (E0367).
Metadata
Metadata
Assignees
Labels
A-auto-traitsArea: auto traits (e.g., `auto trait Send {}`)Area: auto traits (e.g., `auto trait Send {}`)A-synthetic-implsArea: Synthetic impls, used by rustdoc to document auto traits and traits with blanket implsArea: Synthetic impls, used by rustdoc to document auto traits and traits with blanket implsC-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.