Skip to content

Commit 71ebd0d

Browse files
committed
---
yaml --- r: 191018 b: refs/heads/auto c: a5828ff h: refs/heads/master v: v3
1 parent 5ba903d commit 71ebd0d

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 13881df1b2a188b1505b50fde47dfdd8c95a99ee
13+
refs/heads/auto: a5828ff7b0203ac378974c2d30ed94a14073895a
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libsyntax/ast.rs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ pub struct Block {
541541
/// without a semicolon, if any
542542
pub expr: Option<P<Expr>>,
543543
pub id: NodeId,
544-
/// Unsafety of the block
544+
/// Distinguishes between `unsafe { ... }` and `{ ... }`
545545
pub rules: BlockCheckMode,
546546
pub span: Span,
547547
}
@@ -553,11 +553,12 @@ pub struct Pat {
553553
pub span: Span,
554554
}
555555

556-
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
557556
/// A single field in a struct pattern
558557
///
559-
/// For patterns like `Foo {x, y, z}`, `pat` and `ident` point to the same identifier
560-
/// and `is_shorthand` is true.
558+
/// Patterns like the fields of Foo `{ x, ref y, ref mut z }`
559+
/// are treated the same as` x: x, y: ref y, z: ref mut z`,
560+
/// except is_shorthand is true
561+
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
561562
pub struct FieldPat {
562563
/// The identifier for the field
563564
pub ident: Ident,
@@ -601,15 +602,15 @@ pub enum Pat_ {
601602
/// Destructuring of a struct, e.g. `Foo {x, y, ..}`
602603
/// The `bool` is `true` in the presence of a `..`
603604
PatStruct(Path, Vec<Spanned<FieldPat>>, bool),
604-
/// A tuple pattern (`a, b`)
605+
/// A tuple pattern `(a, b)`
605606
PatTup(Vec<P<Pat>>),
606607
/// A `box` pattern
607608
PatBox(P<Pat>),
608609
/// A reference pattern, e.g. `&mut (a, b)`
609610
PatRegion(P<Pat>, Mutability),
610611
/// A literal
611612
PatLit(P<Expr>),
612-
/// A range pattern, e.g. `[1...2]`
613+
/// A range pattern, e.g. `1...2`
613614
PatRange(P<Expr>, P<Expr>),
614615
/// [a, b, ..i, y, z] is represented as:
615616
/// PatVec(box [a, b], Some(i), box [y, z])
@@ -817,28 +818,28 @@ pub enum Expr_ {
817818
ExprIfLet(P<Pat>, P<Expr>, P<Block>, Option<P<Expr>>),
818819
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
819820
/// A while loop, with an optional label
820-
/// `'label while expr { block }`
821+
/// `'label: while expr { block }`
821822
ExprWhile(P<Expr>, P<Block>, Option<Ident>),
822823
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
823824
/// A while-let loop, with an optional label
824-
/// `'label while let pat = expr { block }`
825+
/// `'label: while let pat = expr { block }`
825826
/// This is desugared to a combination of `loop` and `match` expressions
826827
ExprWhileLet(P<Pat>, P<Expr>, P<Block>, Option<Ident>),
827828
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
828829
/// A for loop, with an optional label
829-
/// `'label for pat in expr { block }`
830+
/// `'label: for pat in expr { block }`
830831
/// This is desugared to a combination of `loop` and `match` expressions
831832
ExprForLoop(P<Pat>, P<Expr>, P<Block>, Option<Ident>),
832-
/// Conditionless loop (can be exited with break, cont, or ret)
833-
/// `'label loop { block }`
833+
/// Conditionless loop (can be exited with break, continue, or return)
834+
/// `'label: loop { block }`
834835
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
835836
ExprLoop(P<Block>, Option<Ident>),
836837
/// A `match` block, with a source that indicates whether or not it is
837838
/// the result of a desugaring, and if so, which kind
838839
ExprMatch(P<Expr>, Vec<Arm>, MatchSource),
839840
/// A closure (for example, `move |a, b, c| {a + b + c}`)
840841
ExprClosure(CaptureClause, P<FnDecl>, P<Block>),
841-
/// A block
842+
/// A block (`{ ... }`)
842843
ExprBlock(P<Block>),
843844

844845
/// An assignment (`a = foo()`)
@@ -853,7 +854,7 @@ pub enum Expr_ {
853854
ExprTupField(P<Expr>, Spanned<usize>),
854855
/// An indexing operation (`foo[2]`)
855856
ExprIndex(P<Expr>, P<Expr>),
856-
/// A range (`[1..2]`, `[1..]`, or `[..2]`)
857+
/// A range (`1..2`, `1..`, or `..2`)
857858
ExprRange(Option<P<Expr>>, Option<P<Expr>>),
858859

859860
/// Variable reference, possibly containing `::` and/or type
@@ -877,12 +878,14 @@ pub enum Expr_ {
877878
ExprMac(Mac),
878879

879880
/// A struct literal expression.
880-
/// For example, `Foo {x: 1, y: 2}`
881-
ExprStruct(Path, Vec<Field>, Option<P<Expr>> /* base */),
881+
/// For example, `Foo {x: 1, y: 2}`, or
882+
/// `Foo {x: 1, .. base}`, where `base` is the `Option<Expr>`
883+
ExprStruct(Path, Vec<Field>, Option<P<Expr>>),
882884

883885
/// A vector literal constructed from one repeated element.
884-
/// For example, `[u8; 5]`
885-
ExprRepeat(P<Expr> /* element */, P<Expr> /* count */),
886+
/// For example, `[1u8; 5]`. The first expression is the element
887+
/// to be repeated; the second is the number of times to repeat it
888+
ExprRepeat(P<Expr>, P<Expr>),
886889

887890
/// No-op: used solely so we can pretty-print faithfully
888891
ExprParen(P<Expr>)
@@ -1820,6 +1823,7 @@ pub enum ForeignItem_ {
18201823
/// A foreign function
18211824
ForeignItemFn(P<FnDecl>, Generics),
18221825
/// A foreign static item (`static ext: u8`), with optional mutability
1826+
/// (the boolean is true when mutable)
18231827
ForeignItemStatic(P<Ty>, bool),
18241828
}
18251829

0 commit comments

Comments
 (0)