Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 62a49c3

Browse files
committed
Add tcx lifetime to Binder
1 parent 74851f4 commit 62a49c3

File tree

46 files changed

+274
-228
lines changed

Some content is hidden

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

46 files changed

+274
-228
lines changed

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
293293
self.tcx
294294
}
295295

296-
fn fold_binder<T>(&mut self, t: ty::Binder<T>) -> ty::Binder<T>
296+
fn fold_binder<T>(&mut self, t: ty::Binder<'tcx, T>) -> ty::Binder<'tcx, T>
297297
where
298298
T: TypeFoldable<'tcx>,
299299
{

compiler/rustc_infer/src/infer/combine.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,9 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
545545

546546
fn binders<T>(
547547
&mut self,
548-
a: ty::Binder<T>,
549-
b: ty::Binder<T>,
550-
) -> RelateResult<'tcx, ty::Binder<T>>
548+
a: ty::Binder<'tcx, T>,
549+
b: ty::Binder<'tcx, T>,
550+
) -> RelateResult<'tcx, ty::Binder<'tcx, T>>
551551
where
552552
T: Relate<'tcx>,
553553
{
@@ -840,9 +840,9 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
840840

841841
fn binders<T>(
842842
&mut self,
843-
a: ty::Binder<T>,
844-
b: ty::Binder<T>,
845-
) -> RelateResult<'tcx, ty::Binder<T>>
843+
a: ty::Binder<'tcx, T>,
844+
b: ty::Binder<'tcx, T>,
845+
) -> RelateResult<'tcx, ty::Binder<'tcx, T>>
846846
where
847847
T: Relate<'tcx>,
848848
{

compiler/rustc_infer/src/infer/equate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ impl TypeRelation<'tcx> for Equate<'combine, 'infcx, 'tcx> {
124124

125125
fn binders<T>(
126126
&mut self,
127-
a: ty::Binder<T>,
128-
b: ty::Binder<T>,
129-
) -> RelateResult<'tcx, ty::Binder<T>>
127+
a: ty::Binder<'tcx, T>,
128+
b: ty::Binder<'tcx, T>,
129+
) -> RelateResult<'tcx, ty::Binder<'tcx, T>>
130130
where
131131
T: Relate<'tcx>,
132132
{

compiler/rustc_infer/src/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
514514

515515
fn print_dyn_existential(
516516
self,
517-
_predicates: &'tcx ty::List<ty::Binder<ty::ExistentialPredicate<'tcx>>>,
517+
_predicates: &'tcx ty::List<ty::Binder<'tcx, ty::ExistentialPredicate<'tcx>>>,
518518
) -> Result<Self::DynExistential, Self::Error> {
519519
Err(NonTrivialPath)
520520
}

compiler/rustc_infer/src/infer/glb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ impl TypeRelation<'tcx> for Glb<'combine, 'infcx, 'tcx> {
8585

8686
fn binders<T>(
8787
&mut self,
88-
a: ty::Binder<T>,
89-
b: ty::Binder<T>,
90-
) -> RelateResult<'tcx, ty::Binder<T>>
88+
a: ty::Binder<'tcx, T>,
89+
b: ty::Binder<'tcx, T>,
90+
) -> RelateResult<'tcx, ty::Binder<'tcx, T>>
9191
where
9292
T: Relate<'tcx>,
9393
{

compiler/rustc_infer/src/infer/higher_ranked/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use rustc_middle::ty::{self, Binder, TypeFoldable};
1111
impl<'a, 'tcx> CombineFields<'a, 'tcx> {
1212
pub fn higher_ranked_sub<T>(
1313
&mut self,
14-
a: Binder<T>,
15-
b: Binder<T>,
14+
a: Binder<'tcx, T>,
15+
b: Binder<'tcx, T>,
1616
a_is_expected: bool,
17-
) -> RelateResult<'tcx, Binder<T>>
17+
) -> RelateResult<'tcx, Binder<'tcx, T>>
1818
where
1919
T: Relate<'tcx>,
2020
{
@@ -69,7 +69,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
6969
/// the [rustc dev guide].
7070
///
7171
/// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/traits/hrtb.html
72-
pub fn replace_bound_vars_with_placeholders<T>(&self, binder: ty::Binder<T>) -> T
72+
pub fn replace_bound_vars_with_placeholders<T>(&self, binder: ty::Binder<'tcx, T>) -> T
7373
where
7474
T: TypeFoldable<'tcx>,
7575
{

compiler/rustc_infer/src/infer/lub.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ impl TypeRelation<'tcx> for Lub<'combine, 'infcx, 'tcx> {
8585

8686
fn binders<T>(
8787
&mut self,
88-
a: ty::Binder<T>,
89-
b: ty::Binder<T>,
90-
) -> RelateResult<'tcx, ty::Binder<T>>
88+
a: ty::Binder<'tcx, T>,
89+
b: ty::Binder<'tcx, T>,
90+
) -> RelateResult<'tcx, ty::Binder<'tcx, T>>
9191
where
9292
T: Relate<'tcx>,
9393
{

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
14061406
&self,
14071407
span: Span,
14081408
lbrct: LateBoundRegionConversionTime,
1409-
value: ty::Binder<T>,
1409+
value: ty::Binder<'tcx, T>,
14101410
) -> (T, BTreeMap<ty::BoundRegion, ty::Region<'tcx>>)
14111411
where
14121412
T: TypeFoldable<'tcx>,

compiler/rustc_infer/src/infer/nll_relate/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ where
157157

158158
fn create_scope(
159159
&mut self,
160-
value: ty::Binder<impl Relate<'tcx>>,
160+
value: ty::Binder<'tcx, impl Relate<'tcx>>,
161161
universally_quantified: UniversallyQuantified,
162162
) -> BoundRegionScope<'tcx> {
163163
let mut scope = BoundRegionScope::default();
@@ -608,9 +608,9 @@ where
608608

609609
fn binders<T>(
610610
&mut self,
611-
a: ty::Binder<T>,
612-
b: ty::Binder<T>,
613-
) -> RelateResult<'tcx, ty::Binder<T>>
611+
a: ty::Binder<'tcx, T>,
612+
b: ty::Binder<'tcx, T>,
613+
) -> RelateResult<'tcx, ty::Binder<'tcx, T>>
614614
where
615615
T: Relate<'tcx>,
616616
{
@@ -744,7 +744,7 @@ struct ScopeInstantiator<'me, 'tcx> {
744744
impl<'me, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'me, 'tcx> {
745745
fn visit_binder<T: TypeFoldable<'tcx>>(
746746
&mut self,
747-
t: &ty::Binder<T>,
747+
t: &ty::Binder<'tcx, T>,
748748
) -> ControlFlow<Self::BreakTy> {
749749
self.target_index.shift_in(1);
750750
t.super_visit_with(self);
@@ -997,9 +997,9 @@ where
997997

998998
fn binders<T>(
999999
&mut self,
1000-
a: ty::Binder<T>,
1001-
_: ty::Binder<T>,
1002-
) -> RelateResult<'tcx, ty::Binder<T>>
1000+
a: ty::Binder<'tcx, T>,
1001+
_: ty::Binder<'tcx, T>,
1002+
) -> RelateResult<'tcx, ty::Binder<'tcx, T>>
10031003
where
10041004
T: Relate<'tcx>,
10051005
{

compiler/rustc_infer/src/infer/sub.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ impl TypeRelation<'tcx> for Sub<'combine, 'infcx, 'tcx> {
162162

163163
fn binders<T>(
164164
&mut self,
165-
a: ty::Binder<T>,
166-
b: ty::Binder<T>,
167-
) -> RelateResult<'tcx, ty::Binder<T>>
165+
a: ty::Binder<'tcx, T>,
166+
b: ty::Binder<'tcx, T>,
167+
) -> RelateResult<'tcx, ty::Binder<'tcx, T>>
168168
where
169169
T: Relate<'tcx>,
170170
{

0 commit comments

Comments
 (0)