1- error: expected type, found `1`
2- --> $DIR/E0423.rs:12:39
1+ error: struct literals are not allowed here
2+ --> $DIR/E0423.rs:12:32
33 |
44LL | if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
5- | ^ expecting a type here because of type ascription
6- |
7- = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
8- note: this expression expects an ascribed type after the colon
9- --> $DIR/E0423.rs:12:36
5+ | ^^^^^^^^^^^^^^^^
6+ help: surround the struct literal with parenthesis
107 |
11- LL | if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
12- | ^
13- = help: this might be indicative of a syntax error elsewhere
8+ LL | if let S { x: _x, y: 2 } = (S { x: 1, y: 2 }) { println!("Ok"); }
9+ | ^ ^
1410
1511error: expected expression, found `==`
16- --> $DIR/E0423.rs:15 :13
12+ --> $DIR/E0423.rs:14 :13
1713 |
1814LL | if T {} == T {} { println!("Ok"); }
1915 | ^^ expected expression
2016
21- error: expected type, found `0`
22- --> $DIR/E0423.rs:21:39
17+ error: struct literals are not allowed here
18+ --> $DIR/E0423.rs:20:14
2319 |
2420LL | for _ in std::ops::Range { start: 0, end: 10 } {}
25- | ^ expecting a type here because of type ascription
21+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22+ help: surround the struct literal with parenthesis
2623 |
27- = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
28- note: this expression expects an ascribed type after the colon
29- --> $DIR/E0423.rs:21:32
30- |
31- LL | for _ in std::ops::Range { start: 0, end: 10 } {}
32- | ^^^^^
33- = help: this might be indicative of a syntax error elsewhere
24+ LL | for _ in (std::ops::Range { start: 0, end: 10 }) {}
25+ | ^ ^
3426
3527error[E0423]: expected function, found struct `Foo`
3628 --> $DIR/E0423.rs:4:13
@@ -41,30 +33,14 @@ LL | let f = Foo();
4133 | did you mean `Foo { /* fields */ }`?
4234 | help: a function with a similar name exists: `foo`
4335
44- error[E0423]: expected value, found struct `S`
45- --> $DIR/E0423.rs:12:32
46- |
47- LL | if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
48- | ^---------------
49- | |
50- | help: surround the struct literal with parenthesis: `(S { x: 1, y: 2 })`
51-
5236error[E0423]: expected value, found struct `T`
53- --> $DIR/E0423.rs:15 :8
37+ --> $DIR/E0423.rs:14 :8
5438 |
5539LL | if T {} == T {} { println!("Ok"); }
5640 | ^---
5741 | |
5842 | help: surround the struct literal with parenthesis: `(T {})`
5943
60- error[E0423]: expected value, found struct `std::ops::Range`
61- --> $DIR/E0423.rs:21:14
62- |
63- LL | for _ in std::ops::Range { start: 0, end: 10 } {}
64- | ^^^^^^^^^^^^^^^----------------------
65- | |
66- | help: surround the struct literal with parenthesis: `(std::ops::Range { start: 0, end: 10 })`
67-
68- error: aborting due to 7 previous errors
44+ error: aborting due to 5 previous errors
6945
7046For more information about this error, try `rustc --explain E0423`.
0 commit comments