convert AdtDef::destructor to on-demand
This removes the Cell from AdtDef. Also, moving destructor validity checking to on-demand (forced during item-type checking) ensures that invalid destructors can't cause ICEs. Fixes #38868. Fixes #40132.
This commit is contained in:
parent
e1cb9ba221
commit
e294fd5ecb
11 changed files with 133 additions and 129 deletions
|
|
@ -76,6 +76,10 @@ provide! { <'tcx> tcx, def_id, cdata
|
|||
tcx.alloc_trait_def(cdata.get_trait_def(def_id.index, tcx))
|
||||
}
|
||||
adt_def => { cdata.get_adt_def(def_id.index, tcx) }
|
||||
adt_destructor => {
|
||||
let _ = cdata;
|
||||
tcx.calculate_dtor(def_id, &mut |_,_| Ok(()))
|
||||
}
|
||||
variances => { Rc::new(cdata.get_item_variances(def_id.index)) }
|
||||
associated_item_def_ids => {
|
||||
let mut result = vec![];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue