Skip to content

Commit a9c125f

Browse files
Rollup merge of #125597 - compiler-errors:early-binder, r=jackh726
Uplift `EarlyBinder` into `rustc_type_ir` We also need to give `EarlyBinder` a `'tcx` param, so that we can carry the `Interner` in the `EarlyBinder` too. This is necessary because otherwise we have an unconstrained `I: Interner` parameter in many of the `EarlyBinder`'s inherent impls. I also generally think that this is desirable to have, in case we later want to track some state in the `EarlyBinder`. r? lcnr
2 parents cfa7ab4 + f922929 commit a9c125f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+786
-705
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4686,6 +4686,7 @@ dependencies = [
46864686
"rustc_span",
46874687
"rustc_type_ir_macros",
46884688
"smallvec",
4689+
"tracing",
46894690
]
46904691

46914692
[[package]]

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RemapLateBound<'_, 'tcx> {
449449
pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
450450
tcx: TyCtxt<'tcx>,
451451
impl_m_def_id: LocalDefId,
452-
) -> Result<&'tcx DefIdMap<ty::EarlyBinder<Ty<'tcx>>>, ErrorGuaranteed> {
452+
) -> Result<&'tcx DefIdMap<ty::EarlyBinder<'tcx, Ty<'tcx>>>, ErrorGuaranteed> {
453453
let impl_m = tcx.opt_associated_item(impl_m_def_id.to_def_id()).unwrap();
454454
let trait_m = tcx.opt_associated_item(impl_m.trait_item_def_id.unwrap()).unwrap();
455455
let impl_trait_ref =

compiler/rustc_hir_analysis/src/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ fn trait_def(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::TraitDef {
12771277
}
12781278

12791279
#[instrument(level = "debug", skip(tcx))]
1280-
fn fn_sig(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<ty::PolyFnSig<'_>> {
1280+
fn fn_sig(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<'_, ty::PolyFnSig<'_>> {
12811281
use rustc_hir::Node::*;
12821282
use rustc_hir::*;
12831283

compiler/rustc_hir_analysis/src/collect/item_bounds.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,22 @@ fn opaque_type_bounds<'tcx>(
8282
pub(super) fn explicit_item_bounds(
8383
tcx: TyCtxt<'_>,
8484
def_id: LocalDefId,
85-
) -> ty::EarlyBinder<&'_ [(ty::Clause<'_>, Span)]> {
85+
) -> ty::EarlyBinder<'_, &'_ [(ty::Clause<'_>, Span)]> {
8686
explicit_item_bounds_with_filter(tcx, def_id, PredicateFilter::All)
8787
}
8888

8989
pub(super) fn explicit_item_super_predicates(
9090
tcx: TyCtxt<'_>,
9191
def_id: LocalDefId,
92-
) -> ty::EarlyBinder<&'_ [(ty::Clause<'_>, Span)]> {
92+
) -> ty::EarlyBinder<'_, &'_ [(ty::Clause<'_>, Span)]> {
9393
explicit_item_bounds_with_filter(tcx, def_id, PredicateFilter::SelfOnly)
9494
}
9595

9696
pub(super) fn explicit_item_bounds_with_filter(
9797
tcx: TyCtxt<'_>,
9898
def_id: LocalDefId,
9999
filter: PredicateFilter,
100-
) -> ty::EarlyBinder<&'_ [(ty::Clause<'_>, Span)]> {
100+
) -> ty::EarlyBinder<'_, &'_ [(ty::Clause<'_>, Span)]> {
101101
match tcx.opt_rpitit_info(def_id.to_def_id()) {
102102
// RPITIT's bounds are the same as opaque type bounds, but with
103103
// a projection self type.
@@ -166,7 +166,7 @@ pub(super) fn explicit_item_bounds_with_filter(
166166
ty::EarlyBinder::bind(bounds)
167167
}
168168

169-
pub(super) fn item_bounds(tcx: TyCtxt<'_>, def_id: DefId) -> ty::EarlyBinder<ty::Clauses<'_>> {
169+
pub(super) fn item_bounds(tcx: TyCtxt<'_>, def_id: DefId) -> ty::EarlyBinder<'_, ty::Clauses<'_>> {
170170
tcx.explicit_item_bounds(def_id).map_bound(|bounds| {
171171
tcx.mk_clauses_from_iter(util::elaborate(tcx, bounds.iter().map(|&(bound, _span)| bound)))
172172
})
@@ -175,7 +175,7 @@ pub(super) fn item_bounds(tcx: TyCtxt<'_>, def_id: DefId) -> ty::EarlyBinder<ty:
175175
pub(super) fn item_super_predicates(
176176
tcx: TyCtxt<'_>,
177177
def_id: DefId,
178-
) -> ty::EarlyBinder<ty::Clauses<'_>> {
178+
) -> ty::EarlyBinder<'_, ty::Clauses<'_>> {
179179
tcx.explicit_item_super_predicates(def_id).map_bound(|bounds| {
180180
tcx.mk_clauses_from_iter(
181181
util::elaborate(tcx, bounds.iter().map(|&(bound, _span)| bound)).filter_only_self(),
@@ -186,7 +186,7 @@ pub(super) fn item_super_predicates(
186186
pub(super) fn item_non_self_assumptions(
187187
tcx: TyCtxt<'_>,
188188
def_id: DefId,
189-
) -> ty::EarlyBinder<ty::Clauses<'_>> {
189+
) -> ty::EarlyBinder<'_, ty::Clauses<'_>> {
190190
let all_bounds: FxIndexSet<_> = tcx.item_bounds(def_id).skip_binder().iter().collect();
191191
let own_bounds: FxIndexSet<_> =
192192
tcx.item_super_predicates(def_id).skip_binder().iter().collect();

compiler/rustc_hir_analysis/src/collect/type_of.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ fn get_path_containing_arg_in_pat<'hir>(
309309
arg_path
310310
}
311311

312-
pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty<'_>> {
312+
pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<'_, Ty<'_>> {
313313
use rustc_hir::*;
314314
use rustc_middle::ty::Ty;
315315

@@ -512,7 +512,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
512512
pub(super) fn type_of_opaque(
513513
tcx: TyCtxt<'_>,
514514
def_id: DefId,
515-
) -> Result<ty::EarlyBinder<Ty<'_>>, CyclePlaceholder> {
515+
) -> Result<ty::EarlyBinder<'_, Ty<'_>>, CyclePlaceholder> {
516516
if let Some(def_id) = def_id.as_local() {
517517
use rustc_hir::*;
518518

compiler/rustc_hir_analysis/src/outlives/explicit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use super::utils::*;
66

77
#[derive(Debug)]
88
pub struct ExplicitPredicatesMap<'tcx> {
9-
map: FxIndexMap<DefId, ty::EarlyBinder<RequiredPredicates<'tcx>>>,
9+
map: FxIndexMap<DefId, ty::EarlyBinder<'tcx, RequiredPredicates<'tcx>>>,
1010
}
1111

1212
impl<'tcx> ExplicitPredicatesMap<'tcx> {
@@ -18,7 +18,7 @@ impl<'tcx> ExplicitPredicatesMap<'tcx> {
1818
&mut self,
1919
tcx: TyCtxt<'tcx>,
2020
def_id: DefId,
21-
) -> &ty::EarlyBinder<RequiredPredicates<'tcx>> {
21+
) -> &ty::EarlyBinder<'tcx, RequiredPredicates<'tcx>> {
2222
self.map.entry(def_id).or_insert_with(|| {
2323
let predicates = if def_id.is_local() {
2424
tcx.explicit_predicates_of(def_id)

compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use super::utils::*;
1515
/// now be filled with inferred predicates.
1616
pub(super) fn infer_predicates(
1717
tcx: TyCtxt<'_>,
18-
) -> FxIndexMap<DefId, ty::EarlyBinder<RequiredPredicates<'_>>> {
18+
) -> FxIndexMap<DefId, ty::EarlyBinder<'_, RequiredPredicates<'_>>> {
1919
debug!("infer_predicates");
2020

2121
let mut explicit_map = ExplicitPredicatesMap::new();
@@ -101,7 +101,7 @@ fn insert_required_predicates_to_be_wf<'tcx>(
101101
tcx: TyCtxt<'tcx>,
102102
ty: Ty<'tcx>,
103103
span: Span,
104-
global_inferred_outlives: &FxIndexMap<DefId, ty::EarlyBinder<RequiredPredicates<'tcx>>>,
104+
global_inferred_outlives: &FxIndexMap<DefId, ty::EarlyBinder<'tcx, RequiredPredicates<'tcx>>>,
105105
required_predicates: &mut RequiredPredicates<'tcx>,
106106
explicit_map: &mut ExplicitPredicatesMap<'tcx>,
107107
) {
@@ -322,7 +322,7 @@ fn check_inferred_predicates<'tcx>(
322322
tcx: TyCtxt<'tcx>,
323323
def_id: DefId,
324324
args: ty::GenericArgsRef<'tcx>,
325-
global_inferred_outlives: &FxIndexMap<DefId, ty::EarlyBinder<RequiredPredicates<'tcx>>>,
325+
global_inferred_outlives: &FxIndexMap<DefId, ty::EarlyBinder<'tcx, RequiredPredicates<'tcx>>>,
326326
required_predicates: &mut RequiredPredicates<'tcx>,
327327
) {
328328
// Load the current set of inferred and explicit predicates from `global_inferred_outlives`

compiler/rustc_lint/src/non_local_def.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ fn impl_trait_ref_has_enough_non_local_candidates<'tcx>(
270270
tcx: TyCtxt<'tcx>,
271271
infer_span: Span,
272272
trait_def_id: DefId,
273-
binder: EarlyBinder<TraitRef<'tcx>>,
273+
binder: EarlyBinder<'tcx, TraitRef<'tcx>>,
274274
mut did_has_local_parent: impl FnMut(DefId) -> bool,
275275
) -> bool {
276276
let infcx = tcx

compiler/rustc_metadata/src/rmeta/decoder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10741074
self,
10751075
index: DefIndex,
10761076
tcx: TyCtxt<'tcx>,
1077-
) -> ty::EarlyBinder<&'tcx [(ty::Clause<'tcx>, Span)]> {
1077+
) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
10781078
let lazy = self.root.tables.explicit_item_bounds.get(self, index);
10791079
let output = if lazy.is_default() {
10801080
&mut []
@@ -1088,7 +1088,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
10881088
self,
10891089
index: DefIndex,
10901090
tcx: TyCtxt<'tcx>,
1091-
) -> ty::EarlyBinder<&'tcx [(ty::Clause<'tcx>, Span)]> {
1091+
) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
10921092
let lazy = self.root.tables.explicit_item_super_predicates.get(self, index);
10931093
let output = if lazy.is_default() {
10941094
&mut []

compiler/rustc_metadata/src/rmeta/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -418,19 +418,19 @@ define_tables! {
418418
// As an optimization, we only store this for trait aliases,
419419
// since it's identical to super_predicates_of for traits.
420420
implied_predicates_of: Table<DefIndex, LazyValue<ty::GenericPredicates<'static>>>,
421-
type_of: Table<DefIndex, LazyValue<ty::EarlyBinder<Ty<'static>>>>,
421+
type_of: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, Ty<'static>>>>,
422422
variances_of: Table<DefIndex, LazyArray<ty::Variance>>,
423-
fn_sig: Table<DefIndex, LazyValue<ty::EarlyBinder<ty::PolyFnSig<'static>>>>,
423+
fn_sig: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, ty::PolyFnSig<'static>>>>,
424424
codegen_fn_attrs: Table<DefIndex, LazyValue<CodegenFnAttrs>>,
425425
impl_trait_header: Table<DefIndex, LazyValue<ty::ImplTraitHeader<'static>>>,
426-
const_param_default: Table<DefIndex, LazyValue<ty::EarlyBinder<rustc_middle::ty::Const<'static>>>>,
426+
const_param_default: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, rustc_middle::ty::Const<'static>>>>,
427427
object_lifetime_default: Table<DefIndex, LazyValue<ObjectLifetimeDefault>>,
428428
optimized_mir: Table<DefIndex, LazyValue<mir::Body<'static>>>,
429429
mir_for_ctfe: Table<DefIndex, LazyValue<mir::Body<'static>>>,
430430
closure_saved_names_of_captured_variables: Table<DefIndex, LazyValue<IndexVec<FieldIdx, Symbol>>>,
431431
mir_coroutine_witnesses: Table<DefIndex, LazyValue<mir::CoroutineLayout<'static>>>,
432432
promoted_mir: Table<DefIndex, LazyValue<IndexVec<mir::Promoted, mir::Body<'static>>>>,
433-
thir_abstract_const: Table<DefIndex, LazyValue<ty::EarlyBinder<ty::Const<'static>>>>,
433+
thir_abstract_const: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, ty::Const<'static>>>>,
434434
impl_parent: Table<DefIndex, RawDefId>,
435435
constness: Table<DefIndex, hir::Constness>,
436436
defaultness: Table<DefIndex, hir::Defaultness>,
@@ -459,7 +459,7 @@ define_tables! {
459459
macro_definition: Table<DefIndex, LazyValue<ast::DelimArgs>>,
460460
proc_macro: Table<DefIndex, MacroKind>,
461461
deduced_param_attrs: Table<DefIndex, LazyArray<DeducedParamAttrs>>,
462-
trait_impl_trait_tys: Table<DefIndex, LazyValue<DefIdMap<ty::EarlyBinder<Ty<'static>>>>>,
462+
trait_impl_trait_tys: Table<DefIndex, LazyValue<DefIdMap<ty::EarlyBinder<'static, Ty<'static>>>>>,
463463
doc_link_resolutions: Table<DefIndex, LazyValue<DocLinkResMap>>,
464464
doc_link_traits_in_scope: Table<DefIndex, LazyArray<DefId>>,
465465
assumed_wf_types_for_rpitit: Table<DefIndex, LazyArray<(Ty<'static>, Span)>>,

compiler/rustc_middle/src/arena.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ macro_rules! arena_types {
108108
[decode] trait_impl_trait_tys:
109109
rustc_data_structures::unord::UnordMap<
110110
rustc_hir::def_id::DefId,
111-
rustc_middle::ty::EarlyBinder<rustc_middle::ty::Ty<'tcx>>
111+
rustc_middle::ty::EarlyBinder<'tcx, rustc_middle::ty::Ty<'tcx>>
112112
>,
113113
[] external_constraints: rustc_middle::traits::solve::ExternalConstraintsData<'tcx>,
114114
[] predefined_opaques_in_body: rustc_middle::traits::solve::PredefinedOpaquesData<'tcx>,

compiler/rustc_middle/src/hir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl<'tcx> TyCtxt<'tcx> {
121121
LocalModDefId::new_unchecked(id)
122122
}
123123

124-
pub fn impl_subject(self, def_id: DefId) -> EarlyBinder<ImplSubject<'tcx>> {
124+
pub fn impl_subject(self, def_id: DefId) -> EarlyBinder<'tcx, ImplSubject<'tcx>> {
125125
match self.impl_trait_ref(def_id) {
126126
Some(t) => t.map_bound(ImplSubject::Trait),
127127
None => self.type_of(def_id).map_bound(ImplSubject::Inherent),

compiler/rustc_middle/src/mir/consts.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ pub enum Const<'tcx> {
220220
}
221221

222222
impl<'tcx> Const<'tcx> {
223-
pub fn identity_unevaluated(tcx: TyCtxt<'tcx>, def_id: DefId) -> ty::EarlyBinder<Const<'tcx>> {
223+
pub fn identity_unevaluated(
224+
tcx: TyCtxt<'tcx>,
225+
def_id: DefId,
226+
) -> ty::EarlyBinder<'tcx, Const<'tcx>> {
224227
ty::EarlyBinder::bind(Const::Unevaluated(
225228
UnevaluatedConst {
226229
def: def_id,

compiler/rustc_middle/src/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ impl<'tcx> Body<'tcx> {
624624

625625
/// Returns the return type; it always return first element from `local_decls` array.
626626
#[inline]
627-
pub fn bound_return_ty(&self) -> ty::EarlyBinder<Ty<'tcx>> {
627+
pub fn bound_return_ty(&self) -> ty::EarlyBinder<'tcx, Ty<'tcx>> {
628628
ty::EarlyBinder::bind(self.local_decls[RETURN_PLACE].ty)
629629
}
630630

compiler/rustc_middle/src/query/erase.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ impl EraseType for Result<CoerceUnsizedInfo, rustc_errors::ErrorGuaranteed> {
114114
type Result = [u8; size_of::<Result<CoerceUnsizedInfo, rustc_errors::ErrorGuaranteed>>()];
115115
}
116116

117-
impl EraseType for Result<Option<ty::EarlyBinder<ty::Const<'_>>>, rustc_errors::ErrorGuaranteed> {
117+
impl EraseType
118+
for Result<Option<ty::EarlyBinder<'_, ty::Const<'_>>>, rustc_errors::ErrorGuaranteed>
119+
{
118120
type Result = [u8; size_of::<
119-
Result<Option<ty::EarlyBinder<ty::Const<'static>>>, rustc_errors::ErrorGuaranteed>,
121+
Result<Option<ty::EarlyBinder<'static, ty::Const<'static>>>, rustc_errors::ErrorGuaranteed>,
120122
>()];
121123
}
122124

@@ -165,8 +167,8 @@ impl EraseType for Result<&'_ ty::List<Ty<'_>>, ty::util::AlwaysRequiresDrop> {
165167
[u8; size_of::<Result<&'static ty::List<Ty<'static>>, ty::util::AlwaysRequiresDrop>>()];
166168
}
167169

168-
impl EraseType for Result<ty::EarlyBinder<Ty<'_>>, CyclePlaceholder> {
169-
type Result = [u8; size_of::<Result<ty::EarlyBinder<Ty<'_>>, CyclePlaceholder>>()];
170+
impl EraseType for Result<ty::EarlyBinder<'_, Ty<'_>>, CyclePlaceholder> {
171+
type Result = [u8; size_of::<Result<ty::EarlyBinder<'static, Ty<'_>>, CyclePlaceholder>>()];
170172
}
171173

172174
impl<T> EraseType for Option<&'_ T> {
@@ -185,15 +187,15 @@ impl EraseType for Option<ty::ImplTraitHeader<'_>> {
185187
type Result = [u8; size_of::<Option<ty::ImplTraitHeader<'static>>>()];
186188
}
187189

188-
impl EraseType for Option<ty::EarlyBinder<Ty<'_>>> {
189-
type Result = [u8; size_of::<Option<ty::EarlyBinder<Ty<'static>>>>()];
190+
impl EraseType for Option<ty::EarlyBinder<'_, Ty<'_>>> {
191+
type Result = [u8; size_of::<Option<ty::EarlyBinder<'static, Ty<'static>>>>()];
190192
}
191193

192194
impl EraseType for rustc_hir::MaybeOwner<'_> {
193195
type Result = [u8; size_of::<rustc_hir::MaybeOwner<'static>>()];
194196
}
195197

196-
impl<T: EraseType> EraseType for ty::EarlyBinder<T> {
198+
impl<T: EraseType> EraseType for ty::EarlyBinder<'_, T> {
197199
type Result = T::Result;
198200
}
199201

compiler/rustc_middle/src/query/mod.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ rustc_queries! {
209209

210210
/// Given the def_id of a const-generic parameter, computes the associated default const
211211
/// parameter. e.g. `fn example<const N: usize=3>` called on `N` would return `3`.
212-
query const_param_default(param: DefId) -> ty::EarlyBinder<ty::Const<'tcx>> {
212+
query const_param_default(param: DefId) -> ty::EarlyBinder<'tcx, ty::Const<'tcx>> {
213213
desc { |tcx| "computing const default for a given parameter `{}`", tcx.def_path_str(param) }
214214
cache_on_disk_if { param.is_local() }
215215
separate_provide_extern
@@ -219,7 +219,7 @@ rustc_queries! {
219219
/// to an alias, it will "skip" this alias to return the aliased type.
220220
///
221221
/// [`DefId`]: rustc_hir::def_id::DefId
222-
query type_of(key: DefId) -> ty::EarlyBinder<Ty<'tcx>> {
222+
query type_of(key: DefId) -> ty::EarlyBinder<'tcx, Ty<'tcx>> {
223223
desc { |tcx|
224224
"{action} `{path}`",
225225
action = {
@@ -240,7 +240,7 @@ rustc_queries! {
240240
/// Specialized instance of `type_of` that detects cycles that are due to
241241
/// revealing opaque because of an auto trait bound. Unless `CyclePlaceholder` needs
242242
/// to be handled separately, call `type_of` instead.
243-
query type_of_opaque(key: DefId) -> Result<ty::EarlyBinder<Ty<'tcx>>, CyclePlaceholder> {
243+
query type_of_opaque(key: DefId) -> Result<ty::EarlyBinder<'tcx, Ty<'tcx>>, CyclePlaceholder> {
244244
desc { |tcx|
245245
"computing type of opaque `{path}`",
246246
path = tcx.def_path_str(key),
@@ -257,7 +257,7 @@ rustc_queries! {
257257
}
258258

259259
query collect_return_position_impl_trait_in_trait_tys(key: DefId)
260-
-> Result<&'tcx DefIdMap<ty::EarlyBinder<Ty<'tcx>>>, ErrorGuaranteed>
260+
-> Result<&'tcx DefIdMap<ty::EarlyBinder<'tcx, Ty<'tcx>>>, ErrorGuaranteed>
261261
{
262262
desc { "comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process" }
263263
cache_on_disk_if { key.is_local() }
@@ -363,7 +363,7 @@ rustc_queries! {
363363
/// `key` is the `DefId` of the associated type or opaque type.
364364
///
365365
/// Bounds from the parent (e.g. with nested impl trait) are not included.
366-
query explicit_item_bounds(key: DefId) -> ty::EarlyBinder<&'tcx [(ty::Clause<'tcx>, Span)]> {
366+
query explicit_item_bounds(key: DefId) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
367367
desc { |tcx| "finding item bounds for `{}`", tcx.def_path_str(key) }
368368
cache_on_disk_if { key.is_local() }
369369
separate_provide_extern
@@ -373,7 +373,7 @@ rustc_queries! {
373373
/// share the `Self` type of the item. These are a subset of the bounds
374374
/// that may explicitly be used for things like closure signature
375375
/// deduction.
376-
query explicit_item_super_predicates(key: DefId) -> ty::EarlyBinder<&'tcx [(ty::Clause<'tcx>, Span)]> {
376+
query explicit_item_super_predicates(key: DefId) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
377377
desc { |tcx| "finding item bounds for `{}`", tcx.def_path_str(key) }
378378
cache_on_disk_if { key.is_local() }
379379
separate_provide_extern
@@ -399,15 +399,15 @@ rustc_queries! {
399399
/// ```
400400
///
401401
/// Bounds from the parent (e.g. with nested impl trait) are not included.
402-
query item_bounds(key: DefId) -> ty::EarlyBinder<ty::Clauses<'tcx>> {
402+
query item_bounds(key: DefId) -> ty::EarlyBinder<'tcx, ty::Clauses<'tcx>> {
403403
desc { |tcx| "elaborating item bounds for `{}`", tcx.def_path_str(key) }
404404
}
405405

406-
query item_super_predicates(key: DefId) -> ty::EarlyBinder<ty::Clauses<'tcx>> {
406+
query item_super_predicates(key: DefId) -> ty::EarlyBinder<'tcx, ty::Clauses<'tcx>> {
407407
desc { |tcx| "elaborating item assumptions for `{}`", tcx.def_path_str(key) }
408408
}
409409

410-
query item_non_self_assumptions(key: DefId) -> ty::EarlyBinder<ty::Clauses<'tcx>> {
410+
query item_non_self_assumptions(key: DefId) -> ty::EarlyBinder<'tcx, ty::Clauses<'tcx>> {
411411
desc { |tcx| "elaborating item assumptions for `{}`", tcx.def_path_str(key) }
412412
}
413413

@@ -504,7 +504,7 @@ rustc_queries! {
504504
/// Try to build an abstract representation of the given constant.
505505
query thir_abstract_const(
506506
key: DefId
507-
) -> Result<Option<ty::EarlyBinder<ty::Const<'tcx>>>, ErrorGuaranteed> {
507+
) -> Result<Option<ty::EarlyBinder<'tcx, ty::Const<'tcx>>>, ErrorGuaranteed> {
508508
desc {
509509
|tcx| "building an abstract representation for `{}`", tcx.def_path_str(key),
510510
}
@@ -704,7 +704,7 @@ rustc_queries! {
704704
separate_provide_extern
705705
}
706706

707-
query adt_sized_constraint(key: DefId) -> Option<ty::EarlyBinder<Ty<'tcx>>> {
707+
query adt_sized_constraint(key: DefId) -> Option<ty::EarlyBinder<'tcx, Ty<'tcx>>> {
708708
desc { |tcx| "computing the `Sized` constraint for `{}`", tcx.def_path_str(key) }
709709
}
710710

@@ -849,7 +849,7 @@ rustc_queries! {
849849

850850
query self_ty_of_trait_impl_enabling_order_dep_trait_object_hack(
851851
key: DefId
852-
) -> Option<ty::EarlyBinder<ty::Ty<'tcx>>> {
852+
) -> Option<ty::EarlyBinder<'tcx, ty::Ty<'tcx>>> {
853853
desc { |tcx| "computing self type wrt issue #33140 `{}`", tcx.def_path_str(key) }
854854
}
855855

@@ -888,7 +888,7 @@ rustc_queries! {
888888
}
889889

890890
/// Computes the signature of the function.
891-
query fn_sig(key: DefId) -> ty::EarlyBinder<ty::PolyFnSig<'tcx>> {
891+
query fn_sig(key: DefId) -> ty::EarlyBinder<'tcx, ty::PolyFnSig<'tcx>> {
892892
desc { |tcx| "computing function signature of `{}`", tcx.def_path_str(key) }
893893
cache_on_disk_if { key.is_local() }
894894
separate_provide_extern

0 commit comments

Comments
 (0)