diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 41565019c6b..9ac9ee66f6a 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -830,11 +830,14 @@ fn item_typedef(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::T document(w, cx, it, None); + let def_id = it.def_id.expect_real(); // Render any items associated directly to this alias, as otherwise they // won't be visible anywhere in the docs. It would be nice to also show // associated items from the aliased type (see discussion in #32077), but // we need #14072 to make sense of the generics. - render_assoc_items(w, cx, it, it.def_id.expect_real(), AssocItemRender::All) + render_assoc_items(w, cx, it, def_id, AssocItemRender::All); + + document_ty_layout(w, cx, def_id); } fn item_union(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::Union) { diff --git a/src/test/rustdoc/type-layout.rs b/src/test/rustdoc/type-layout.rs index 261f407a906..e18bdeba913 100644 --- a/src/test/rustdoc/type-layout.rs +++ b/src/test/rustdoc/type-layout.rs @@ -36,7 +36,8 @@ pub struct Generic(T); // @has - '(unsized)' pub struct Unsized([u8]); -// @!has type_layout/type.TypeAlias.html 'Size: ' +// @has type_layout/type.TypeAlias.html 'Size: ' +// @has - ' bytes' pub type TypeAlias = X; // @!has type_layout/trait.MyTrait.html 'Size: '