11error: expected one of `,`, `.`, `?`, `}`, or an operator, found `;`
2- --> $DIR/syntax-error-not-missing-field.rs:12 :30
2+ --> $DIR/syntax-error-not-missing-field.rs:16 :30
33 |
44LL | let f = Foo { a: make_a(); b: 2 };
55 | --- ^
@@ -9,7 +9,7 @@ LL | let f = Foo { a: make_a(); b: 2 };
99 | while parsing this struct
1010
1111error: expected one of `,`, `.`, `?`, `}`, or an operator, found `b`
12- --> $DIR/syntax-error-not-missing-field.rs:16 :31
12+ --> $DIR/syntax-error-not-missing-field.rs:20 :31
1313 |
1414LL | let f = Foo { a: make_a() b: 2 };
1515 | --- -^ expected one of `,`, `.`, `?`, `}`, or an operator
@@ -18,7 +18,7 @@ LL | let f = Foo { a: make_a() b: 2 };
1818 | while parsing this struct
1919
2020error: cannot use a comma after the base struct
21- --> $DIR/syntax-error-not-missing-field.rs:20 :32
21+ --> $DIR/syntax-error-not-missing-field.rs:24 :32
2222 |
2323LL | let f = Foo { a: make_a(), ..todo!(), };
2424 | ^^^^^^^^^
@@ -31,7 +31,7 @@ LL + let f = Foo { a: make_a(), ..todo!() };
3131 |
3232
3333error: expected one of `,`, `:`, or `}`, found `(`
34- --> $DIR/syntax-error-not-missing-field.rs:24 :25
34+ --> $DIR/syntax-error-not-missing-field.rs:28 :25
3535 |
3636LL | let f = Foo { make_a(), b: 2, };
3737 | --- ------^ expected one of `,`, `:`, or `}`
@@ -45,23 +45,23 @@ LL | let f = Foo { make_a: make_a(), b: 2, };
4545 | +++++++
4646
4747error: expected `,`
48- --> $DIR/syntax-error-not-missing-field.rs:27 :31
48+ --> $DIR/syntax-error-not-missing-field.rs:31 :31
4949 |
5050LL | fn pat_wrong_separator(Foo { a; b }: Foo) {
5151 | --- ^
5252 | |
5353 | while parsing the fields for this pattern
5454
5555error: expected `,`
56- --> $DIR/syntax-error-not-missing-field.rs:31 :34
56+ --> $DIR/syntax-error-not-missing-field.rs:35 :34
5757 |
5858LL | fn pat_missing_separator(Foo { a b }: Foo) {
5959 | --- ^
6060 | |
6161 | while parsing the fields for this pattern
6262
6363error: expected `}`, found `,`
64- --> $DIR/syntax-error-not-missing-field.rs:35 :39
64+ --> $DIR/syntax-error-not-missing-field.rs:39 :39
6565 |
6666LL | fn pat_rest_trailing_comma(Foo { a, .., }: Foo) {
6767 | --^
@@ -70,5 +70,24 @@ LL | fn pat_rest_trailing_comma(Foo { a, .., }: Foo) {
7070 | | help: remove this comma
7171 | `..` must be at the end and cannot have a trailing comma
7272
73- error: aborting due to 7 previous errors
73+ error: expected one of `,`, `.`, `?`, `}`, or an operator, found `;`
74+ --> $DIR/syntax-error-not-missing-field.rs:43:35
75+ |
76+ LL | let e = Bar::Baz { a: make_a(); b: 2 };
77+ | -------- ^
78+ | | |
79+ | | expected one of `,`, `.`, `?`, `}`, or an operator
80+ | | help: try adding a comma: `,`
81+ | while parsing this struct
82+
83+ error: expected one of `,`, `.`, `?`, `}`, or an operator, found `b`
84+ --> $DIR/syntax-error-not-missing-field.rs:47:36
85+ |
86+ LL | let e = Bar::Baz { a: make_a() b: 2 };
87+ | -------- -^ expected one of `,`, `.`, `?`, `}`, or an operator
88+ | | |
89+ | | help: try adding a comma: `,`
90+ | while parsing this struct
91+
92+ error: aborting due to 9 previous errors
7493
0 commit comments