@@ -150,7 +150,7 @@ impl PartialEq for Ident {
150
150
151
151
/// A SyntaxContext represents a chain of macro-expandings
152
152
/// and renamings. Each macro expansion corresponds to
153
- /// a fresh usize
153
+ /// a fresh u32
154
154
155
155
// I'm representing this syntax context as an index into
156
156
// a table, in order to work around a compiler bug
@@ -216,6 +216,7 @@ pub struct Lifetime {
216
216
}
217
217
218
218
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
219
+ /// A lifetime definition, eg `'a: 'b+'c+'d`
219
220
pub struct LifetimeDef {
220
221
pub lifetime : Lifetime ,
221
222
pub bounds : Vec < Lifetime >
@@ -251,7 +252,9 @@ pub struct PathSegment {
251
252
252
253
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
253
254
pub enum PathParameters {
255
+ /// The `<'a, A,B,C>` in `foo::bar::baz::<'a, A,B,C>`
254
256
AngleBracketedParameters ( AngleBracketedParameterData ) ,
257
+ /// The `(A,B)` and `C` in `Foo(A,B) -> C`
255
258
ParenthesizedParameters ( ParenthesizedParameterData ) ,
256
259
}
257
260
@@ -436,34 +439,45 @@ impl Generics {
436
439
}
437
440
}
438
441
442
+ /// A `where` clause in a definition
439
443
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
440
444
pub struct WhereClause {
441
445
pub id : NodeId ,
442
446
pub predicates : Vec < WherePredicate > ,
443
447
}
444
448
449
+ /// A single predicate in a `where` clause
445
450
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
446
451
pub enum WherePredicate {
452
+ /// A type binding, eg `for<'c> Foo: Send+Clone+'c`
447
453
BoundPredicate ( WhereBoundPredicate ) ,
454
+ /// A lifetime predicate, e.g. `'a: 'b+'c`
448
455
RegionPredicate ( WhereRegionPredicate ) ,
456
+ /// An equality predicate (unsupported)
449
457
EqPredicate ( WhereEqPredicate )
450
458
}
451
459
460
+ /// A type bound, eg `for<'c> Foo: Send+Clone+'c`
452
461
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
453
462
pub struct WhereBoundPredicate {
454
463
pub span : Span ,
464
+ /// Any lifetimes from a `for` binding
455
465
pub bound_lifetimes : Vec < LifetimeDef > ,
466
+ /// The type being bounded
456
467
pub bounded_ty : P < Ty > ,
468
+ /// Trait and lifetime bounds (`Clone+Send+'static`)
457
469
pub bounds : OwnedSlice < TyParamBound > ,
458
470
}
459
471
472
+ /// A lifetime predicate, e.g. `'a: 'b+'c`
460
473
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
461
474
pub struct WhereRegionPredicate {
462
475
pub span : Span ,
463
476
pub lifetime : Lifetime ,
464
477
pub bounds : Vec < Lifetime > ,
465
478
}
466
479
480
+ /// An equality predicate (unsupported), e.g. `T=int`
467
481
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
468
482
pub struct WhereEqPredicate {
469
483
pub id : NodeId ,
0 commit comments