Skip to content

Commit 1e35938

Browse files
committed
easy changes in higher_ranked/mod.rs
1 parent 56e7fb3 commit 1e35938

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

compiler/rustc_infer/src/infer/fudge.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,16 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
166166
}
167167
}
168168

169-
pub struct InferenceFudger<'a, 'tcx> {
170-
infcx: &'a InferCtxt<'a, 'tcx>,
169+
pub struct InferenceFudger<'a, 'cx, 'tcx> {
170+
infcx: &'a mut InferCtxt<'cx, 'tcx>,
171171
type_vars: (Range<TyVid>, Vec<TypeVariableOrigin>),
172172
int_vars: Range<IntVid>,
173173
float_vars: Range<FloatVid>,
174174
region_vars: (Range<RegionVid>, Vec<RegionVariableOrigin>),
175175
const_vars: (Range<ConstVid<'tcx>>, Vec<ConstVariableOrigin>),
176176
}
177177

178-
impl<'a, 'tcx> TypeFolder<'tcx> for InferenceFudger<'a, 'tcx> {
178+
impl<'a, 'tcx> TypeFolder<'tcx> for InferenceFudger<'a, '_, 'tcx> {
179179
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
180180
self.infcx.tcx
181181
}

compiler/rustc_infer/src/infer/glb.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ impl TypeRelation<'tcx> for Glb<'_, 'combine, 'infcx, 'tcx> {
6666
) -> RelateResult<'tcx, ty::Region<'tcx>> {
6767
debug!("{}.regions({:?}, {:?})", self.tag(), a, b);
6868

69+
let tcx = self.tcx();
6970
let origin = Subtype(box self.fields.trace.clone());
7071
Ok(self.fields.infcx.inner.unwrap_region_constraints().glb_regions(
71-
self.tcx(),
72+
tcx,
7273
origin,
7374
a,
7475
b,
@@ -102,7 +103,7 @@ impl TypeRelation<'tcx> for Glb<'_, 'combine, 'infcx, 'tcx> {
102103
}
103104

104105
impl<'combine, 'infcx, 'tcx> LatticeDir<'infcx, 'tcx> for Glb<'_, 'combine, 'infcx, 'tcx> {
105-
fn infcx(&self) -> &InferCtxt<'infcx, 'tcx> {
106+
fn infcx(&mut self) -> &mut InferCtxt<'infcx, 'tcx> {
106107
self.fields.infcx
107108
}
108109

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
123123

124124
/// See `infer::region_constraints::RegionConstraintCollector::leak_check`.
125125
pub fn leak_check(
126-
&self,
126+
&mut self,
127127
overly_polymorphic: bool,
128128
snapshot: &CombinedSnapshot<'_, 'tcx>,
129129
) -> RelateResult<'tcx, ()> {
@@ -137,10 +137,11 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
137137
return Ok(());
138138
}
139139

140+
let universe = self.universe();
140141
self.inner.unwrap_region_constraints().leak_check(
141142
self.tcx,
142143
overly_polymorphic,
143-
self.universe(),
144+
universe,
144145
snapshot,
145146
)
146147
}

compiler/rustc_infer/src/infer/lattice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use rustc_middle::ty::TyVar;
2828
use rustc_middle::ty::{self, Ty};
2929

3030
pub trait LatticeDir<'f, 'tcx>: TypeRelation<'tcx> {
31-
fn infcx(&self) -> &InferCtxt<'f, 'tcx>;
31+
fn infcx(&mut self) -> &mut InferCtxt<'f, 'tcx>;
3232

3333
fn cause(&self) -> &ObligationCause<'tcx>;
3434

compiler/rustc_infer/src/infer/lub.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl<'tcx> ConstEquateRelation<'tcx> for Lub<'_, '_, '_, 'tcx> {
108108
}
109109

110110
impl<'combine, 'infcx, 'tcx> LatticeDir<'infcx, 'tcx> for Lub<'_, 'combine, 'infcx, 'tcx> {
111-
fn infcx(&self) -> &InferCtxt<'infcx, 'tcx> {
111+
fn infcx(&mut self) -> &mut InferCtxt<'infcx, 'tcx> {
112112
self.fields.infcx
113113
}
114114

0 commit comments

Comments
 (0)