Add associated_items_for_impl_trait_in_trait query
This commit is contained in:
parent
833b9154ac
commit
4e703a2772
9 changed files with 68 additions and 4 deletions
|
@ -248,6 +248,8 @@ provide! { tcx, def_id, other, cdata,
|
|||
.process_decoded(tcx, || panic!("{def_id:?} does not have trait_impl_trait_tys")))
|
||||
}
|
||||
|
||||
associated_items_for_impl_trait_in_trait => { table_defaulted_array }
|
||||
|
||||
visibility => { cdata.get_visibility(def_id.index) }
|
||||
adt_def => { cdata.get_adt_def(def_id.index, tcx) }
|
||||
adt_destructor => {
|
||||
|
|
|
@ -1129,6 +1129,11 @@ fn should_encode_trait_impl_trait_tys(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
|
|||
})
|
||||
}
|
||||
|
||||
// Return `false` to avoid encoding impl trait in trait, while we don't use the query.
|
||||
fn should_encode_fn_impl_trait_in_trait<'tcx>(_tcx: TyCtxt<'tcx>, _def_id: DefId) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
||||
fn encode_attrs(&mut self, def_id: LocalDefId) {
|
||||
let tcx = self.tcx;
|
||||
|
@ -1211,6 +1216,10 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||
{
|
||||
record!(self.tables.trait_impl_trait_tys[def_id] <- table);
|
||||
}
|
||||
if should_encode_fn_impl_trait_in_trait(tcx, def_id) {
|
||||
let table = tcx.associated_items_for_impl_trait_in_trait(def_id);
|
||||
record_defaulted_array!(self.tables.associated_items_for_impl_trait_in_trait[def_id] <- table);
|
||||
}
|
||||
}
|
||||
|
||||
let inherent_impls = tcx.with_stable_hashing_context(|hcx| {
|
||||
|
|
|
@ -354,6 +354,7 @@ define_tables! {
|
|||
explicit_item_bounds: Table<DefIndex, LazyArray<(ty::Predicate<'static>, Span)>>,
|
||||
inferred_outlives_of: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
|
||||
inherent_impls: Table<DefIndex, LazyArray<DefIndex>>,
|
||||
associated_items_for_impl_trait_in_trait: Table<DefIndex, LazyArray<DefId>>,
|
||||
|
||||
- optional:
|
||||
attributes: Table<DefIndex, LazyArray<ast::Attribute>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue