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
3
3
|
4
4
LL | 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
10
7
|
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
+ | ^ ^
14
10
15
11
error: expected expression, found `==`
16
- --> $DIR/E0423.rs:15 :13
12
+ --> $DIR/E0423.rs:14 :13
17
13
|
18
14
LL | if T {} == T {} { println!("Ok"); }
19
15
| ^^ expected expression
20
16
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
23
19
|
24
20
LL | 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
26
23
|
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
+ | ^ ^
34
26
35
27
error[E0423]: expected function, found struct `Foo`
36
28
--> $DIR/E0423.rs:4:13
@@ -41,30 +33,14 @@ LL | let f = Foo();
41
33
| did you mean `Foo { /* fields */ }`?
42
34
| help: a function with a similar name exists: `foo`
43
35
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
-
52
36
error[E0423]: expected value, found struct `T`
53
- --> $DIR/E0423.rs:15 :8
37
+ --> $DIR/E0423.rs:14 :8
54
38
|
55
39
LL | if T {} == T {} { println!("Ok"); }
56
40
| ^---
57
41
| |
58
42
| help: surround the struct literal with parenthesis: `(T {})`
59
43
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
69
45
70
46
For more information about this error, try `rustc --explain E0423`.
0 commit comments