Skip to content

Commit 64012a1

Browse files
committed
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`.
1 parent 3e7035f commit 64012a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/type_of.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ pub fn uncached_gcc_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, layout: TyAndLa
5656
if let (&ty::Adt(def, _), &Variants::Single { index }) =
5757
(layout.ty.kind(), &layout.variants)
5858
{
59-
if def.is_enum() && !def.variants.is_empty() {
60-
write!(&mut name, "::{}", def.variants[index].name).unwrap();
59+
if def.is_enum() && !def.variants().is_empty() {
60+
write!(&mut name, "::{}", def.variant(index).name).unwrap();
6161
}
6262
}
6363
if let (&ty::Generator(_, _, _), &Variants::Single { index }) =

0 commit comments

Comments
 (0)