1
Fork 0

add EarlyBinder to output of explicit_item_bounds; replace bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query

This commit is contained in:
Kyle Matsuda 2023-04-17 16:43:46 -06:00
parent 0892a7380b
commit f3b279fcc5
26 changed files with 49 additions and 56 deletions

View file

@ -203,7 +203,11 @@ impl IntoArgs for (CrateNum, SimplifiedType) {
}
provide! { tcx, def_id, other, cdata,
explicit_item_bounds => { table_defaulted_array }
explicit_item_bounds => {
let lazy = cdata.root.tables.explicit_item_bounds.get(cdata, def_id.index);
let output = if lazy.is_default() { &mut [] } else { tcx.arena.alloc_from_iter(lazy.decode((cdata, tcx))) };
ty::EarlyBinder(&*output)
}
explicit_predicates_of => { table }
generics_of => { table }
inferred_outlives_of => { table_defaulted_array }

View file

@ -1425,7 +1425,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
fn encode_explicit_item_bounds(&mut self, def_id: DefId) {
debug!("EncodeContext::encode_explicit_item_bounds({:?})", def_id);
let bounds = self.tcx.explicit_item_bounds(def_id);
let bounds = self.tcx.explicit_item_bounds(def_id).skip_binder();
record_defaulted_array!(self.tables.explicit_item_bounds[def_id] <- bounds);
}