about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorCamelid <camelidcamel@gmail.com>2021-04-12 19:23:49 -0700
committerCamelid <camelidcamel@gmail.com>2021-05-11 09:55:31 -0700
commit48da66f28f078c0dc31068a30977e9079c876d90 (patch)
tree5ea5bdfe5c3c1ad93984f77dfaa3d2aae2459281 /src/librustdoc/html/render
parent9859e2b01d2498ea0465a36bf4055d45e1f96f5b (diff)
downloadrust-48da66f28f078c0dc31068a30977e9079c876d90.tar.gz
rust-48da66f28f078c0dc31068a30977e9079c876d90.zip
Show memory layout for type aliases
At first you might think "why not just click through to the aliased
type?", but if a type alias instantiates all of the generic parameters
of the aliased type, then it can show layout info even though the
aliased type cannot (because we can't compute the layout of a generic
type). So I think it's still useful to show layout info for type
aliases.
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/print_item.rs5
1 files changed, 4 insertions, 1 deletions
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) {