We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
with
1 parent abef5f5 commit f394933Copy full SHA for f394933
src/libsyntax/parse/parser.rs
@@ -724,6 +724,12 @@ class parser {
724
let mut fields = [self.parse_field(token::COLON)];
725
let mut base = none;
726
while self.token != token::RBRACE {
727
+ // optional comma before "with"
728
+ if self.token == token::COMMA
729
+ && self.token_is_keyword("with",
730
+ self.look_ahead(1u)) {
731
+ self.bump();
732
+ }
733
if self.eat_keyword("with") {
734
base = some(self.parse_expr()); break;
735
}
src/test/run-pass/issue-2463.rs
@@ -0,0 +1,19 @@
1
+fn main() {
2
+
3
+ let x = {
4
+ f: 0,
5
+ g: 0,
6
+ };
7
8
+ let y = {
9
+ f: 1,
10
+ g: 1,
11
+ with x
12
13
14
+ let z = {
15
16
17
18
19
+}
0 commit comments