diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-03-05 07:28:41 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-03-11 13:31:24 +1100 |
| commit | 64012a1c2e386f0b34516106a92d84b45492ef0a (patch) | |
| tree | 46d3df7428c57a23bf084b7f4c816ef30f2bcd0b | |
| parent | 3e7035fa86af022ed047e7a1b1540584e2b61234 (diff) | |
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`.
| -rw-r--r-- | src/type_of.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/type_of.rs b/src/type_of.rs index 0ada20cad2c..649ffc16249 100644 --- a/src/type_of.rs +++ b/src/type_of.rs @@ -56,8 +56,8 @@ pub fn uncached_gcc_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, layout: TyAndLa if let (&ty::Adt(def, _), &Variants::Single { index }) = (layout.ty.kind(), &layout.variants) { - if def.is_enum() && !def.variants.is_empty() { - write!(&mut name, "::{}", def.variants[index].name).unwrap(); + if def.is_enum() && !def.variants().is_empty() { + write!(&mut name, "::{}", def.variant(index).name).unwrap(); } } if let (&ty::Generator(_, _, _), &Variants::Single { index }) = |
