Skip to content

Commit 9d0b55a

Browse files
committed
---
yaml --- r: 34009 b: refs/heads/snap-stage3 c: 184f510 h: refs/heads/master i: 34007: 7a32c8f v: v3
1 parent 0f5c84e commit 9d0b55a

File tree

3 files changed

+14
-30
lines changed

3 files changed

+14
-30
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: cb7996a565b4cc37601c5248aa889fb108023f9a
4+
refs/heads/snap-stage3: 184f5102b37c9a52342382fe9e88144a62cd9782
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,8 +2046,6 @@ impl Parser {
20462046
pat = self.parse_pat_ident(refutable, bind_by_value);
20472047
} else if self.eat_keyword(~"move") {
20482048
pat = self.parse_pat_ident(refutable, bind_by_move);
2049-
} else if !is_plain_ident(self.token) {
2050-
pat = self.parse_enum_variant(refutable);
20512049
} else {
20522050
let binding_mode;
20532051
// XXX: Aren't these two cases deadcode? -- bblum
@@ -2066,7 +2064,7 @@ impl Parser {
20662064
let cannot_be_enum_or_struct;
20672065
match self.look_ahead(1) {
20682066
token::LPAREN | token::LBRACKET | token::LT |
2069-
token::LBRACE =>
2067+
token::LBRACE | token::MOD_SEP =>
20702068
cannot_be_enum_or_struct = false,
20712069
_ =>
20722070
cannot_be_enum_or_struct = true
@@ -2163,32 +2161,6 @@ impl Parser {
21632161
pat_ident(binding_mode, name, sub)
21642162
}
21652163
2166-
fn parse_enum_variant(refutable: bool) -> ast::pat_ {
2167-
let enum_path = self.parse_path_with_tps(true);
2168-
match self.token {
2169-
token::LPAREN => {
2170-
match self.look_ahead(1u) {
2171-
token::BINOP(token::STAR) => { // foo(*)
2172-
self.expect(token::LPAREN);
2173-
self.expect(token::BINOP(token::STAR));
2174-
self.expect(token::RPAREN);
2175-
pat_enum(enum_path, None)
2176-
}
2177-
_ => { // foo(a, ..., z)
2178-
let args = self.parse_unspanned_seq(
2179-
token::LPAREN, token::RPAREN,
2180-
seq_sep_trailing_disallowed(token::COMMA),
2181-
|p| p.parse_pat(refutable));
2182-
pat_enum(enum_path, Some(args))
2183-
}
2184-
}
2185-
}
2186-
_ => { // option::None
2187-
pat_enum(enum_path, Some(~[]))
2188-
}
2189-
}
2190-
}
2191-
21922164
fn parse_local(is_mutbl: bool,
21932165
allow_init: bool) -> @local {
21942166
let lo = self.span.lo;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
mod m {
2+
pub struct S {
3+
x: int,
4+
y: int
5+
}
6+
}
7+
8+
fn main() {
9+
let x = m::S { x: 1, y: 2 };
10+
let m::S { x: a, y: b } = x;
11+
}
12+

0 commit comments

Comments
 (0)