- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
C-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
I know the displaying of #[repr(...)] in general has some issues, and this certainly seems related.
Currently the aliased type is stored as a TypeAliasInnerType, which does not have enough info to find the original ADT and render the repr (or other attributes, for that matter). For example:
#[repr(C)]
pub struct Foo {
    a: u8,
    pub b: u8,
    c: u8,
    pub d: u8,
    e: u8,
}
pub type Bar = Foo;where Foo is rendered as
#[repr(C)]
pub struct Foo {
    pub b: u8,
    pub d: u8,
    /* private fields */
}but on the docs page for Bar it is
struct Bar {
    pub b: u8,
    pub d: u8,
    /* private fields */
}The example also hits #66401, so I think the proper solution is to really use the exact same rendering code for the aliased types as for the original type. That prevents such mismatches, though I may be missing why that was not done in the first place, maybe there is a good reason.
@rustbot label +T-rustdoc
Metadata
Metadata
Assignees
Labels
C-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.