Skip to content

Commit 5e39032

Browse files
Rename infcx lifetimes in inference relations
1 parent cdb0867 commit 5e39032

File tree

6 files changed

+46
-46
lines changed

6 files changed

+46
-46
lines changed

src/librustc/infer/bivariate.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ use ty::{self, Ty, TyCtxt};
3232
use ty::TyVar;
3333
use ty::relate::{Relate, RelateResult, TypeRelation};
3434

35-
pub struct Bivariate<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
36-
fields: CombineFields<'a, 'gcx, 'tcx>
35+
pub struct Bivariate<'infcx, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {
36+
fields: CombineFields<'infcx, 'gcx, 'tcx>
3737
}
3838

39-
impl<'a, 'gcx, 'tcx> Bivariate<'a, 'gcx, 'tcx> {
40-
pub fn new(fields: CombineFields<'a, 'gcx, 'tcx>) -> Bivariate<'a, 'gcx, 'tcx> {
39+
impl<'infcx, 'gcx, 'tcx> Bivariate<'infcx, 'gcx, 'tcx> {
40+
pub fn new(fields: CombineFields<'infcx, 'gcx, 'tcx>) -> Bivariate<'infcx, 'gcx, 'tcx> {
4141
Bivariate { fields: fields }
4242
}
4343
}
4444

45-
impl<'a, 'gcx, 'tcx> TypeRelation<'a, 'gcx, 'tcx> for Bivariate<'a, 'gcx, 'tcx> {
45+
impl<'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Bivariate<'infcx, 'gcx, 'tcx> {
4646
fn tag(&self) -> &'static str { "Bivariate" }
4747

48-
fn tcx(&self) -> TyCtxt<'a, 'gcx, 'tcx> { self.fields.tcx() }
48+
fn tcx(&self) -> TyCtxt<'infcx, 'gcx, 'tcx> { self.fields.tcx() }
4949

5050
fn a_is_expected(&self) -> bool { self.fields.a_is_expected }
5151

src/librustc/infer/combine.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,21 @@ use syntax::ast;
5252
use syntax_pos::Span;
5353

5454
#[derive(Clone)]
55-
pub struct CombineFields<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
56-
pub infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,
55+
pub struct CombineFields<'infcx, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {
56+
pub infcx: &'infcx InferCtxt<'infcx, 'gcx, 'tcx>,
5757
pub a_is_expected: bool,
5858
pub trace: TypeTrace<'tcx>,
5959
pub cause: Option<ty::relate::Cause>,
6060
pub obligations: PredicateObligations<'tcx>,
6161
}
6262

63-
impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
63+
impl<'infcx, 'gcx, 'tcx> InferCtxt<'infcx, 'gcx, 'tcx> {
6464
pub fn super_combine_tys<R>(&self,
6565
relation: &mut R,
6666
a: Ty<'tcx>,
6767
b: Ty<'tcx>)
6868
-> RelateResult<'tcx, Ty<'tcx>>
69-
where R: TypeRelation<'a, 'gcx, 'tcx>
69+
where R: TypeRelation<'infcx, 'gcx, 'tcx>
7070
{
7171
let a_is_expected = relation.a_is_expected();
7272

@@ -150,35 +150,35 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
150150
}
151151
}
152152

153-
impl<'a, 'gcx, 'tcx> CombineFields<'a, 'gcx, 'tcx> {
154-
pub fn tcx(&self) -> TyCtxt<'a, 'gcx, 'tcx> {
153+
impl<'infcx, 'gcx, 'tcx> CombineFields<'infcx, 'gcx, 'tcx> {
154+
pub fn tcx(&self) -> TyCtxt<'infcx, 'gcx, 'tcx> {
155155
self.infcx.tcx
156156
}
157157

158-
pub fn switch_expected(&self) -> CombineFields<'a, 'gcx, 'tcx> {
158+
pub fn switch_expected(&self) -> CombineFields<'infcx, 'gcx, 'tcx> {
159159
CombineFields {
160160
a_is_expected: !self.a_is_expected,
161161
..(*self).clone()
162162
}
163163
}
164164

165-
pub fn equate(&self) -> Equate<'a, 'gcx, 'tcx> {
165+
pub fn equate(&self) -> Equate<'infcx, 'gcx, 'tcx> {
166166
Equate::new(self.clone())
167167
}
168168

169-
pub fn bivariate(&self) -> Bivariate<'a, 'gcx, 'tcx> {
169+
pub fn bivariate(&self) -> Bivariate<'infcx, 'gcx, 'tcx> {
170170
Bivariate::new(self.clone())
171171
}
172172

173-
pub fn sub(&self) -> Sub<'a, 'gcx, 'tcx> {
173+
pub fn sub(&self) -> Sub<'infcx, 'gcx, 'tcx> {
174174
Sub::new(self.clone())
175175
}
176176

177-
pub fn lub(&self) -> Lub<'a, 'gcx, 'tcx> {
177+
pub fn lub(&self) -> Lub<'infcx, 'gcx, 'tcx> {
178178
Lub::new(self.clone())
179179
}
180180

181-
pub fn glb(&self) -> Glb<'a, 'gcx, 'tcx> {
181+
pub fn glb(&self) -> Glb<'infcx, 'gcx, 'tcx> {
182182
Glb::new(self.clone())
183183
}
184184

src/librustc/infer/equate.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ use ty::relate::{Relate, RelateResult, TypeRelation};
1818
use traits::PredicateObligations;
1919

2020
/// Ensures `a` is made equal to `b`. Returns `a` on success.
21-
pub struct Equate<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
22-
fields: CombineFields<'a, 'gcx, 'tcx>
21+
pub struct Equate<'infcx, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {
22+
fields: CombineFields<'infcx, 'gcx, 'tcx>
2323
}
2424

25-
impl<'a, 'gcx, 'tcx> Equate<'a, 'gcx, 'tcx> {
26-
pub fn new(fields: CombineFields<'a, 'gcx, 'tcx>) -> Equate<'a, 'gcx, 'tcx> {
25+
impl<'infcx, 'gcx, 'tcx> Equate<'infcx, 'gcx, 'tcx> {
26+
pub fn new(fields: CombineFields<'infcx, 'gcx, 'tcx>) -> Equate<'infcx, 'gcx, 'tcx> {
2727
Equate { fields: fields }
2828
}
2929

@@ -32,10 +32,10 @@ impl<'a, 'gcx, 'tcx> Equate<'a, 'gcx, 'tcx> {
3232
}
3333
}
3434

35-
impl<'a, 'gcx, 'tcx> TypeRelation<'a, 'gcx, 'tcx> for Equate<'a, 'gcx, 'tcx> {
35+
impl<'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Equate<'infcx, 'gcx, 'tcx> {
3636
fn tag(&self) -> &'static str { "Equate" }
3737

38-
fn tcx(&self) -> TyCtxt<'a, 'gcx, 'tcx> { self.fields.tcx() }
38+
fn tcx(&self) -> TyCtxt<'infcx, 'gcx, 'tcx> { self.fields.tcx() }
3939

4040
fn a_is_expected(&self) -> bool { self.fields.a_is_expected }
4141

src/librustc/infer/glb.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ use ty::relate::{Relate, RelateResult, TypeRelation};
1818
use traits::PredicateObligations;
1919

2020
/// "Greatest lower bound" (common subtype)
21-
pub struct Glb<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
22-
fields: CombineFields<'a, 'gcx, 'tcx>
21+
pub struct Glb<'infcx, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {
22+
fields: CombineFields<'infcx, 'gcx, 'tcx>
2323
}
2424

25-
impl<'a, 'gcx, 'tcx> Glb<'a, 'gcx, 'tcx> {
26-
pub fn new(fields: CombineFields<'a, 'gcx, 'tcx>) -> Glb<'a, 'gcx, 'tcx> {
25+
impl<'infcx, 'gcx, 'tcx> Glb<'infcx, 'gcx, 'tcx> {
26+
pub fn new(fields: CombineFields<'infcx, 'gcx, 'tcx>) -> Glb<'infcx, 'gcx, 'tcx> {
2727
Glb { fields: fields }
2828
}
2929

@@ -32,10 +32,10 @@ impl<'a, 'gcx, 'tcx> Glb<'a, 'gcx, 'tcx> {
3232
}
3333
}
3434

35-
impl<'a, 'gcx, 'tcx> TypeRelation<'a, 'gcx, 'tcx> for Glb<'a, 'gcx, 'tcx> {
35+
impl<'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Glb<'infcx, 'gcx, 'tcx> {
3636
fn tag(&self) -> &'static str { "Glb" }
3737

38-
fn tcx(&self) -> TyCtxt<'a, 'gcx, 'tcx> { self.fields.tcx() }
38+
fn tcx(&self) -> TyCtxt<'infcx, 'gcx, 'tcx> { self.fields.tcx() }
3939

4040
fn a_is_expected(&self) -> bool { self.fields.a_is_expected }
4141

@@ -75,8 +75,8 @@ impl<'a, 'gcx, 'tcx> TypeRelation<'a, 'gcx, 'tcx> for Glb<'a, 'gcx, 'tcx> {
7575
}
7676
}
7777

78-
impl<'a, 'gcx, 'tcx> LatticeDir<'a, 'gcx, 'tcx> for Glb<'a, 'gcx, 'tcx> {
79-
fn infcx(&self) -> &'a InferCtxt<'a, 'gcx, 'tcx> {
78+
impl<'infcx, 'gcx, 'tcx> LatticeDir<'infcx, 'gcx, 'tcx> for Glb<'infcx, 'gcx, 'tcx> {
79+
fn infcx(&self) -> &'infcx InferCtxt<'infcx, 'gcx, 'tcx> {
8080
self.fields.infcx
8181
}
8282

src/librustc/infer/lub.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ use ty::relate::{Relate, RelateResult, TypeRelation};
1818
use traits::PredicateObligations;
1919

2020
/// "Least upper bound" (common supertype)
21-
pub struct Lub<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
22-
fields: CombineFields<'a, 'gcx, 'tcx>
21+
pub struct Lub<'infcx, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {
22+
fields: CombineFields<'infcx, 'gcx, 'tcx>
2323
}
2424

25-
impl<'a, 'gcx, 'tcx> Lub<'a, 'gcx, 'tcx> {
26-
pub fn new(fields: CombineFields<'a, 'gcx, 'tcx>) -> Lub<'a, 'gcx, 'tcx> {
25+
impl<'infcx, 'gcx, 'tcx> Lub<'infcx, 'gcx, 'tcx> {
26+
pub fn new(fields: CombineFields<'infcx, 'gcx, 'tcx>) -> Lub<'infcx, 'gcx, 'tcx> {
2727
Lub { fields: fields }
2828
}
2929

@@ -32,10 +32,10 @@ impl<'a, 'gcx, 'tcx> Lub<'a, 'gcx, 'tcx> {
3232
}
3333
}
3434

35-
impl<'a, 'gcx, 'tcx> TypeRelation<'a, 'gcx, 'tcx> for Lub<'a, 'gcx, 'tcx> {
35+
impl<'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Lub<'infcx, 'gcx, 'tcx> {
3636
fn tag(&self) -> &'static str { "Lub" }
3737

38-
fn tcx(&self) -> TyCtxt<'a, 'gcx, 'tcx> { self.fields.tcx() }
38+
fn tcx(&self) -> TyCtxt<'infcx, 'gcx, 'tcx> { self.fields.tcx() }
3939

4040
fn a_is_expected(&self) -> bool { self.fields.a_is_expected }
4141

@@ -75,8 +75,8 @@ impl<'a, 'gcx, 'tcx> TypeRelation<'a, 'gcx, 'tcx> for Lub<'a, 'gcx, 'tcx> {
7575
}
7676
}
7777

78-
impl<'a, 'gcx, 'tcx> LatticeDir<'a, 'gcx, 'tcx> for Lub<'a, 'gcx, 'tcx> {
79-
fn infcx(&self) -> &'a InferCtxt<'a, 'gcx, 'tcx> {
78+
impl<'infcx, 'gcx, 'tcx> LatticeDir<'infcx, 'gcx, 'tcx> for Lub<'infcx, 'gcx, 'tcx> {
79+
fn infcx(&self) -> &'infcx InferCtxt<'infcx, 'gcx, 'tcx> {
8080
self.fields.infcx
8181
}
8282

src/librustc/infer/sub.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ use traits::PredicateObligations;
1919
use std::mem;
2020

2121
/// Ensures `a` is made a subtype of `b`. Returns `a` on success.
22-
pub struct Sub<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
23-
fields: CombineFields<'a, 'gcx, 'tcx>,
22+
pub struct Sub<'infcx, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {
23+
fields: CombineFields<'infcx, 'gcx, 'tcx>,
2424
}
2525

26-
impl<'a, 'gcx, 'tcx> Sub<'a, 'gcx, 'tcx> {
27-
pub fn new(f: CombineFields<'a, 'gcx, 'tcx>) -> Sub<'a, 'gcx, 'tcx> {
26+
impl<'infcx, 'gcx, 'tcx> Sub<'infcx, 'gcx, 'tcx> {
27+
pub fn new(f: CombineFields<'infcx, 'gcx, 'tcx>) -> Sub<'infcx, 'gcx, 'tcx> {
2828
Sub { fields: f }
2929
}
3030

@@ -33,9 +33,9 @@ impl<'a, 'gcx, 'tcx> Sub<'a, 'gcx, 'tcx> {
3333
}
3434
}
3535

36-
impl<'a, 'gcx, 'tcx> TypeRelation<'a, 'gcx, 'tcx> for Sub<'a, 'gcx, 'tcx> {
36+
impl<'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Sub<'infcx, 'gcx, 'tcx> {
3737
fn tag(&self) -> &'static str { "Sub" }
38-
fn tcx(&self) -> TyCtxt<'a, 'gcx, 'tcx> { self.fields.infcx.tcx }
38+
fn tcx(&self) -> TyCtxt<'infcx, 'gcx, 'tcx> { self.fields.infcx.tcx }
3939
fn a_is_expected(&self) -> bool { self.fields.a_is_expected }
4040

4141
fn with_cause<F,R>(&mut self, cause: Cause, f: F) -> R

0 commit comments

Comments
 (0)