about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-03-05 07:28:41 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2022-03-11 13:31:24 +1100
commitca5525d5643f4eb7de5c5e69d0691fc8f1cacfca (patch)
treecbe3682d3e3ff0d1a48b76f972f0322ea28c9542 /src/librustdoc/html/render
parent5f4e0677190b82e61dc507e3e72caf89da8e5e28 (diff)
downloadrust-ca5525d5643f4eb7de5c5e69d0691fc8f1cacfca.tar.gz
rust-ca5525d5643f4eb7de5c5e69d0691fc8f1cacfca.zip
Improve `AdtDef` interning.
This commit makes `AdtDef` use `Interned`. Much the commit is tedious
changes to introduce getter functions. The interesting changes are in
`compiler/rustc_middle/src/ty/adt.rs`.
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/print_item.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 68644a017a4..e6c7745c6e1 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -1765,7 +1765,7 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
                     };
 
                     for (index, layout) in variants.iter_enumerated() {
-                        let name = adt.variants[index].name;
+                        let name = adt.variant(index).name;
                         write!(w, "<li><code>{name}</code>: ", name = name);
                         write_size_of_layout(w, *layout, tag_size);
                         writeln!(w, "</li>");