Skip to content

Commit 12ac537

Browse files
committed
---
yaml --- r: 191420 b: refs/heads/try c: 1debe9d h: refs/heads/master v: v3
1 parent 54bf7e0 commit 12ac537

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 809a554fca2d0ebc2ba50077016fe282a4064752
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c64d671671aea2e44ee7fc6eb00ee75fc30ed7b9
5-
refs/heads/try: c42067c9e9ac605fc330c3ed11d29477ac251d8a
5+
refs/heads/try: 1debe9d112010a23c76711f557ee6fdc4728f4ec
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libsyntax/ast.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl PartialEq for Ident {
150150

151151
/// A SyntaxContext represents a chain of macro-expandings
152152
/// and renamings. Each macro expansion corresponds to
153-
/// a fresh usize
153+
/// a fresh u32
154154
155155
// I'm representing this syntax context as an index into
156156
// a table, in order to work around a compiler bug
@@ -216,6 +216,7 @@ pub struct Lifetime {
216216
}
217217

218218
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
219+
/// A lifetime definition, eg `'a: 'b+'c+'d`
219220
pub struct LifetimeDef {
220221
pub lifetime: Lifetime,
221222
pub bounds: Vec<Lifetime>
@@ -251,7 +252,9 @@ pub struct PathSegment {
251252

252253
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
253254
pub enum PathParameters {
255+
/// The `<'a, A,B,C>` in `foo::bar::baz::<'a, A,B,C>`
254256
AngleBracketedParameters(AngleBracketedParameterData),
257+
/// The `(A,B)` and `C` in `Foo(A,B) -> C`
255258
ParenthesizedParameters(ParenthesizedParameterData),
256259
}
257260

@@ -436,34 +439,45 @@ impl Generics {
436439
}
437440
}
438441

442+
/// A `where` clause in a definition
439443
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
440444
pub struct WhereClause {
441445
pub id: NodeId,
442446
pub predicates: Vec<WherePredicate>,
443447
}
444448

449+
/// A single predicate in a `where` clause
445450
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
446451
pub enum WherePredicate {
452+
/// A type binding, eg `for<'c> Foo: Send+Clone+'c`
447453
BoundPredicate(WhereBoundPredicate),
454+
/// A lifetime predicate, e.g. `'a: 'b+'c`
448455
RegionPredicate(WhereRegionPredicate),
456+
/// An equality predicate (unsupported)
449457
EqPredicate(WhereEqPredicate)
450458
}
451459

460+
/// A type bound, eg `for<'c> Foo: Send+Clone+'c`
452461
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
453462
pub struct WhereBoundPredicate {
454463
pub span: Span,
464+
/// Any lifetimes from a `for` binding
455465
pub bound_lifetimes: Vec<LifetimeDef>,
466+
/// The type being bounded
456467
pub bounded_ty: P<Ty>,
468+
/// Trait and lifetime bounds (`Clone+Send+'static`)
457469
pub bounds: OwnedSlice<TyParamBound>,
458470
}
459471

472+
/// A lifetime predicate, e.g. `'a: 'b+'c`
460473
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
461474
pub struct WhereRegionPredicate {
462475
pub span: Span,
463476
pub lifetime: Lifetime,
464477
pub bounds: Vec<Lifetime>,
465478
}
466479

480+
/// An equality predicate (unsupported), e.g. `T=int`
467481
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
468482
pub struct WhereEqPredicate {
469483
pub id: NodeId,

0 commit comments

Comments
 (0)