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`.
This commit is contained in:
parent
5f4e067719
commit
ca5525d564
169 changed files with 702 additions and 687 deletions
|
@ -760,10 +760,10 @@ pub fn build_adt_ctor(tcx: TyCtxt<'_>, ctor_id: DefId) -> Body<'_> {
|
|||
|
||||
let statements = expand_aggregate(
|
||||
Place::return_place(),
|
||||
adt_def.variants[variant_index].fields.iter().enumerate().map(|(idx, field_def)| {
|
||||
adt_def.variant(variant_index).fields.iter().enumerate().map(|(idx, field_def)| {
|
||||
(Operand::Move(Place::from(Local::new(idx + 1))), field_def.ty(tcx, substs))
|
||||
}),
|
||||
AggregateKind::Adt(adt_def.did, variant_index, substs, None, None),
|
||||
AggregateKind::Adt(adt_def.did(), variant_index, substs, None, None),
|
||||
source_info,
|
||||
tcx,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue