Skip to content

Commit 4bcf013

Browse files
Tidy up
1 parent e88df94 commit 4bcf013

File tree

6 files changed

+38
-13
lines changed

6 files changed

+38
-13
lines changed

src/librustc/infer/bivariate.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@ pub struct Bivariate<'combine, 'infcx: 'combine, 'gcx: 'infcx+'tcx, 'tcx: 'infcx
3838
}
3939

4040
impl<'combine, 'infcx, 'gcx, 'tcx> Bivariate<'combine, 'infcx, 'gcx, 'tcx> {
41-
pub fn new(fields: &'combine mut CombineFields<'infcx, 'gcx, 'tcx>, a_is_expected: bool) -> Bivariate<'combine, 'infcx, 'gcx, 'tcx> {
41+
pub fn new(fields: &'combine mut CombineFields<'infcx, 'gcx, 'tcx>, a_is_expected: bool)
42+
-> Bivariate<'combine, 'infcx, 'gcx, 'tcx>
43+
{
4244
Bivariate { fields: fields, a_is_expected: a_is_expected }
4345
}
4446
}
4547

46-
impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Bivariate<'combine, 'infcx, 'gcx, 'tcx> {
48+
impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx>
49+
for Bivariate<'combine, 'infcx, 'gcx, 'tcx>
50+
{
4751
fn tag(&self) -> &'static str { "Bivariate" }
4852

4953
fn tcx(&self) -> TyCtxt<'infcx, 'gcx, 'tcx> { self.fields.tcx() }

src/librustc/infer/combine.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ impl<'infcx, 'gcx, 'tcx> CombineFields<'infcx, 'gcx, 'tcx> {
251251
BiTo => self.bivariate(a_is_expected).relate(&a_ty, &b_ty),
252252
EqTo => self.equate(a_is_expected).relate(&a_ty, &b_ty),
253253
SubtypeOf => self.sub(a_is_expected).relate(&a_ty, &b_ty),
254-
SupertypeOf => self.sub(a_is_expected).relate_with_variance(ty::Contravariant, &a_ty, &b_ty),
254+
SupertypeOf => self.sub(a_is_expected).relate_with_variance(
255+
ty::Contravariant, &a_ty, &b_ty),
255256
}?;
256257
}
257258

src/librustc/infer/equate.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ pub struct Equate<'combine, 'infcx: 'combine, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {
2323
}
2424

2525
impl<'combine, 'infcx, 'gcx, 'tcx> Equate<'combine, 'infcx, 'gcx, 'tcx> {
26-
pub fn new(fields: &'combine mut CombineFields<'infcx, 'gcx, 'tcx>, a_is_expected: bool) -> Equate<'combine, 'infcx, 'gcx, 'tcx> {
26+
pub fn new(fields: &'combine mut CombineFields<'infcx, 'gcx, 'tcx>, a_is_expected: bool)
27+
-> Equate<'combine, 'infcx, 'gcx, 'tcx>
28+
{
2729
Equate { fields: fields, a_is_expected: a_is_expected }
2830
}
2931
}
3032

31-
impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Equate<'combine, 'infcx, 'gcx, 'tcx> {
33+
impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx>
34+
for Equate<'combine, 'infcx, 'gcx, 'tcx>
35+
{
3236
fn tag(&self) -> &'static str { "Equate" }
3337

3438
fn tcx(&self) -> TyCtxt<'infcx, 'gcx, 'tcx> { self.fields.tcx() }

src/librustc/infer/glb.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ pub struct Glb<'combine, 'infcx: 'combine, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {
2323
}
2424

2525
impl<'combine, 'infcx, 'gcx, 'tcx> Glb<'combine, 'infcx, 'gcx, 'tcx> {
26-
pub fn new(fields: &'combine mut CombineFields<'infcx, 'gcx, 'tcx>, a_is_expected: bool) -> Glb<'combine, 'infcx, 'gcx, 'tcx> {
26+
pub fn new(fields: &'combine mut CombineFields<'infcx, 'gcx, 'tcx>, a_is_expected: bool)
27+
-> Glb<'combine, 'infcx, 'gcx, 'tcx>
28+
{
2729
Glb { fields: fields, a_is_expected: a_is_expected }
2830
}
2931
}
3032

31-
impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Glb<'combine, 'infcx, 'gcx, 'tcx> {
33+
impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx>
34+
for Glb<'combine, 'infcx, 'gcx, 'tcx>
35+
{
3236
fn tag(&self) -> &'static str { "Glb" }
3337

3438
fn tcx(&self) -> TyCtxt<'infcx, 'gcx, 'tcx> { self.fields.tcx() }
@@ -71,7 +75,9 @@ impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Glb<'com
7175
}
7276
}
7377

74-
impl<'combine, 'infcx, 'gcx, 'tcx> LatticeDir<'infcx, 'gcx, 'tcx> for Glb<'combine, 'infcx, 'gcx, 'tcx> {
78+
impl<'combine, 'infcx, 'gcx, 'tcx> LatticeDir<'infcx, 'gcx, 'tcx>
79+
for Glb<'combine, 'infcx, 'gcx, 'tcx>
80+
{
7581
fn infcx(&self) -> &'infcx InferCtxt<'infcx, 'gcx, 'tcx> {
7682
self.fields.infcx
7783
}

src/librustc/infer/lub.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ pub struct Lub<'combine, 'infcx: 'combine, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {
2323
}
2424

2525
impl<'combine, 'infcx, 'gcx, 'tcx> Lub<'combine, 'infcx, 'gcx, 'tcx> {
26-
pub fn new(fields: &'combine mut CombineFields<'infcx, 'gcx, 'tcx>, a_is_expected: bool) -> Lub<'combine, 'infcx, 'gcx, 'tcx> {
26+
pub fn new(fields: &'combine mut CombineFields<'infcx, 'gcx, 'tcx>, a_is_expected: bool)
27+
-> Lub<'combine, 'infcx, 'gcx, 'tcx>
28+
{
2729
Lub { fields: fields, a_is_expected: a_is_expected }
2830
}
2931
}
3032

31-
impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Lub<'combine, 'infcx, 'gcx, 'tcx> {
33+
impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx>
34+
for Lub<'combine, 'infcx, 'gcx, 'tcx>
35+
{
3236
fn tag(&self) -> &'static str { "Lub" }
3337

3438
fn tcx(&self) -> TyCtxt<'infcx, 'gcx, 'tcx> { self.fields.tcx() }
@@ -71,7 +75,9 @@ impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Lub<'com
7175
}
7276
}
7377

74-
impl<'combine, 'infcx, 'gcx, 'tcx> LatticeDir<'infcx, 'gcx, 'tcx> for Lub<'combine, 'infcx, 'gcx, 'tcx> {
78+
impl<'combine, 'infcx, 'gcx, 'tcx> LatticeDir<'infcx, 'gcx, 'tcx>
79+
for Lub<'combine, 'infcx, 'gcx, 'tcx>
80+
{
7581
fn infcx(&self) -> &'infcx InferCtxt<'infcx, 'gcx, 'tcx> {
7682
self.fields.infcx
7783
}

src/librustc/infer/sub.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ pub struct Sub<'combine, 'infcx: 'combine, 'gcx: 'infcx+'tcx, 'tcx: 'infcx> {
2424
}
2525

2626
impl<'combine, 'infcx, 'gcx, 'tcx> Sub<'combine, 'infcx, 'gcx, 'tcx> {
27-
pub fn new(f: &'combine mut CombineFields<'infcx, 'gcx, 'tcx>, a_is_expected: bool) -> Sub<'combine, 'infcx, 'gcx, 'tcx> {
27+
pub fn new(f: &'combine mut CombineFields<'infcx, 'gcx, 'tcx>, a_is_expected: bool)
28+
-> Sub<'combine, 'infcx, 'gcx, 'tcx>
29+
{
2830
Sub { fields: f, a_is_expected: a_is_expected }
2931
}
3032

@@ -36,7 +38,9 @@ impl<'combine, 'infcx, 'gcx, 'tcx> Sub<'combine, 'infcx, 'gcx, 'tcx> {
3638
}
3739
}
3840

39-
impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Sub<'combine, 'infcx, 'gcx, 'tcx> {
41+
impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx>
42+
for Sub<'combine, 'infcx, 'gcx, 'tcx>
43+
{
4044
fn tag(&self) -> &'static str { "Sub" }
4145
fn tcx(&self) -> TyCtxt<'infcx, 'gcx, 'tcx> { self.fields.infcx.tcx }
4246
fn a_is_expected(&self) -> bool { self.a_is_expected }

0 commit comments

Comments
 (0)