1
Fork 0

Auto merge of #94733 - nnethercote:fix-AdtDef-interning, r=fee1-dead

Improve `AdtDef` interning.

This commit makes `AdtDef` use `Interned`. Much of the commit is tedious
changes to introduce getter functions. The interesting changes are in
`compiler/rustc_middle/src/ty/adt.rs`.

r? `@fee1-dead`
This commit is contained in:
bors 2022-03-12 07:02:05 +00:00
commit 012720ffb0
169 changed files with 702 additions and 687 deletions

View file

@ -164,7 +164,7 @@ impl<'tcx> CapturedPlace<'tcx> {
write!(
&mut symbol,
"__{}",
def.variants[variant].fields[idx as usize].name.as_str(),
def.variant(variant).fields[idx as usize].name.as_str(),
)
.unwrap();
}
@ -330,7 +330,7 @@ pub fn place_to_string_for_capture<'tcx>(tcx: TyCtxt<'tcx>, place: &HirPlace<'tc
curr_string = format!(
"{}.{}",
curr_string,
def.variants[variant].fields[idx as usize].name.as_str()
def.variant(variant).fields[idx as usize].name.as_str()
);
}
ty::Tuple(_) => {