@@ -544,14 +544,14 @@ impl<'tcx> TyS<'tcx> {
544
544
pub fn is_primitive_ty ( & self ) -> bool {
545
545
match self . sty {
546
546
TyKind :: Bool |
547
- TyKind :: Char |
548
- TyKind :: Int ( _) |
549
- TyKind :: Uint ( _) |
550
- TyKind :: Float ( _) |
551
- TyKind :: Infer ( InferTy :: IntVar ( _) ) |
552
- TyKind :: Infer ( InferTy :: FloatVar ( _) ) |
553
- TyKind :: Infer ( InferTy :: FreshIntTy ( _) ) |
554
- TyKind :: Infer ( InferTy :: FreshFloatTy ( _) ) => true ,
547
+ TyKind :: Char |
548
+ TyKind :: Int ( _) |
549
+ TyKind :: Uint ( _) |
550
+ TyKind :: Float ( _) |
551
+ TyKind :: Infer ( InferTy :: IntVar ( _) ) |
552
+ TyKind :: Infer ( InferTy :: FloatVar ( _) ) |
553
+ TyKind :: Infer ( InferTy :: FreshIntTy ( _) ) |
554
+ TyKind :: Infer ( InferTy :: FreshFloatTy ( _) ) => true ,
555
555
TyKind :: Ref ( _, x, _) => x. is_primitive_ty ( ) ,
556
556
_ => false ,
557
557
}
@@ -1042,15 +1042,15 @@ impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> {
1042
1042
1043
1043
#[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
1044
1044
pub enum Predicate < ' tcx > {
1045
- /// Corresponds to `where Foo : Bar<A,B,C>`. `Foo` here would be
1045
+ /// Corresponds to `where Foo: Bar<A,B,C>`. `Foo` here would be
1046
1046
/// the `Self` type of the trait reference and `A`, `B`, and `C`
1047
1047
/// would be the type parameters.
1048
1048
Trait ( PolyTraitPredicate < ' tcx > ) ,
1049
1049
1050
- /// where `'a : 'b`
1050
+ /// where `'a: 'b`
1051
1051
RegionOutlives ( PolyRegionOutlivesPredicate < ' tcx > ) ,
1052
1052
1053
- /// where `T : 'a`
1053
+ /// where `T: 'a`
1054
1054
TypeOutlives ( PolyTypeOutlivesPredicate < ' tcx > ) ,
1055
1055
1056
1056
/// where `<T as TraitRef>::Name == X`, approximately.
@@ -1063,7 +1063,7 @@ pub enum Predicate<'tcx> {
1063
1063
/// trait must be object-safe
1064
1064
ObjectSafe ( DefId ) ,
1065
1065
1066
- /// No direct syntax. May be thought of as `where T : FnFoo<...>`
1066
+ /// No direct syntax. May be thought of as `where T: FnFoo<...>`
1067
1067
/// for some substitutions `...` and `T` being a closure type.
1068
1068
/// Satisfied (or refuted) once we know the closure's kind.
1069
1069
ClosureKind ( DefId , ClosureSubsts < ' tcx > , ClosureKind ) ,
@@ -1112,11 +1112,11 @@ impl<'a, 'gcx, 'tcx> Predicate<'tcx> {
1112
1112
//
1113
1113
// Let's start with an easy case. Consider two traits:
1114
1114
//
1115
- // trait Foo<'a> : Bar<'a,'a> { }
1115
+ // trait Foo<'a>: Bar<'a,'a> { }
1116
1116
// trait Bar<'b,'c> { }
1117
1117
//
1118
- // Now, if we have a trait reference `for<'x> T : Foo<'x>`, then
1119
- // we can deduce that `for<'x> T : Bar<'x,'x>`. Basically, if we
1118
+ // Now, if we have a trait reference `for<'x> T: Foo<'x>`, then
1119
+ // we can deduce that `for<'x> T: Bar<'x,'x>`. Basically, if we
1120
1120
// knew that `Foo<'x>` (for any 'x) then we also know that
1121
1121
// `Bar<'x,'x>` (for any 'x). This more-or-less falls out from
1122
1122
// normal substitution.
@@ -1129,21 +1129,21 @@ impl<'a, 'gcx, 'tcx> Predicate<'tcx> {
1129
1129
//
1130
1130
// Another example to be careful of is this:
1131
1131
//
1132
- // trait Foo1<'a> : for<'b> Bar1<'a,'b> { }
1132
+ // trait Foo1<'a>: for<'b> Bar1<'a,'b> { }
1133
1133
// trait Bar1<'b,'c> { }
1134
1134
//
1135
- // Here, if we have `for<'x> T : Foo1<'x>`, then what do we know?
1136
- // The answer is that we know `for<'x,'b> T : Bar1<'x,'b>`. The
1135
+ // Here, if we have `for<'x> T: Foo1<'x>`, then what do we know?
1136
+ // The answer is that we know `for<'x,'b> T: Bar1<'x,'b>`. The
1137
1137
// reason is similar to the previous example: any impl of
1138
- // `T:Foo1<'x>` must show that `for<'b> T : Bar1<'x, 'b>`. So
1138
+ // `T:Foo1<'x>` must show that `for<'b> T: Bar1<'x, 'b>`. So
1139
1139
// basically we would want to collapse the bound lifetimes from
1140
1140
// the input (`trait_ref`) and the supertraits.
1141
1141
//
1142
1142
// To achieve this in practice is fairly straightforward. Let's
1143
1143
// consider the more complicated scenario:
1144
1144
//
1145
- // - We start out with `for<'x> T : Foo1<'x>`. In this case, `'x`
1146
- // has a De Bruijn index of 1. We want to produce `for<'x,'b> T : Bar1<'x,'b>`,
1145
+ // - We start out with `for<'x> T: Foo1<'x>`. In this case, `'x`
1146
+ // has a De Bruijn index of 1. We want to produce `for<'x,'b> T: Bar1<'x,'b>`,
1147
1147
// where both `'x` and `'b` would have a DB index of 1.
1148
1148
// The substitution from the input trait-ref is therefore going to be
1149
1149
// `'a => 'x` (where `'x` has a DB index of 1).
@@ -1219,7 +1219,7 @@ impl<'tcx> PolyTraitPredicate<'tcx> {
1219
1219
}
1220
1220
1221
1221
#[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash , Debug , RustcEncodable , RustcDecodable ) ]
1222
- pub struct OutlivesPredicate < A , B > ( pub A , pub B ) ; // `A : B`
1222
+ pub struct OutlivesPredicate < A , B > ( pub A , pub B ) ; // `A: B`
1223
1223
pub type PolyOutlivesPredicate < A , B > = ty:: Binder < OutlivesPredicate < A , B > > ;
1224
1224
pub type RegionOutlivesPredicate < ' tcx > = OutlivesPredicate < ty:: Region < ' tcx > ,
1225
1225
ty:: Region < ' tcx > > ;
@@ -2476,7 +2476,7 @@ impl<'tcx> TyS<'tcx> {
2476
2476
///
2477
2477
/// Note: prefer `ty.walk()` where possible.
2478
2478
pub fn maybe_walk < F > ( & ' tcx self , mut f : F )
2479
- where F : FnMut ( Ty < ' tcx > ) -> bool
2479
+ where F : FnMut ( Ty < ' tcx > ) -> bool
2480
2480
{
2481
2481
let mut walker = self . walk ( ) ;
2482
2482
while let Some ( ty) = walker. next ( ) {
0 commit comments