@@ -9,23 +9,51 @@ help: you might have meant to use pattern matching
9
9
LL | if let Some(x) = foo {}
10
10
| ^^^
11
11
12
+ error[E0658]: destructuring assignments are unstable
13
+ --> $DIR/if-let-typo.rs:4:16
14
+ |
15
+ LL | if Some(x) = foo {}
16
+ | ------- ^
17
+ | |
18
+ | cannot assign to this expression
19
+ |
20
+ = note: see issue #71126 <https://github.com/rust-lang/rust/issues/71126> for more information
21
+ = help: add `#![feature(destructuring_assignment)]` to the crate attributes to enable
22
+
12
23
error[E0308]: mismatched types
13
- --> $DIR/if-let-typo.rs:5:8
24
+ --> $DIR/if-let-typo.rs:4:8
25
+ |
26
+ LL | if Some(x) = foo {}
27
+ | ^^^^^^^^^^^^^ expected `bool`, found `()`
28
+
29
+ error[E0658]: destructuring assignments are unstable
30
+ --> $DIR/if-let-typo.rs:7:18
14
31
|
15
32
LL | if Some(foo) = bar {}
16
- | ^^^^^^^^^^^^^^^ expected `bool`, found `()`
33
+ | --------- ^
34
+ | |
35
+ | cannot assign to this expression
17
36
|
18
- help: you might have meant to use pattern matching
37
+ = note: see issue #71126 <https://github.com/rust-lang/rust/issues/71126> for more information
38
+ = help: add `#![feature(destructuring_assignment)]` to the crate attributes to enable
39
+
40
+ error[E0308]: mismatched types
41
+ --> $DIR/if-let-typo.rs:7:8
19
42
|
20
- LL | if let Some(foo) = bar {}
21
- | ^^^
22
- help: you might have meant to compare for equality
43
+ LL | if Some(foo) = bar {}
44
+ | ^^^^^^^^^^^^^^^ expected `bool`, found `()`
45
+
46
+ error[E0308]: mismatched types
47
+ --> $DIR/if-let-typo.rs:9:12
48
+ |
49
+ LL | if 3 = foo {}
50
+ | ^^^ expected integer, found enum `Option`
23
51
|
24
- LL | if Some(foo) == bar {}
25
- | ^^
52
+ = note: expected type `{integer}`
53
+ found enum `Option<{integer}>`
26
54
27
55
error[E0308]: mismatched types
28
- --> $DIR/if-let-typo.rs:6 :8
56
+ --> $DIR/if-let-typo.rs:9 :8
29
57
|
30
58
LL | if 3 = foo {}
31
59
| ^^^^^^^ expected `bool`, found `()`
@@ -35,22 +63,32 @@ help: you might have meant to use pattern matching
35
63
LL | if let 3 = foo {}
36
64
| ^^^
37
65
38
- error[E0308 ]: mismatched types
39
- --> $DIR/if-let-typo.rs:7:8
66
+ error[E0658 ]: destructuring assignments are unstable
67
+ --> $DIR/if-let-typo.rs:11:16
40
68
|
41
69
LL | if Some(3) = foo {}
42
- | ^^^^^^^^^^^^^ expected `bool`, found `()`
70
+ | ------- ^
71
+ | |
72
+ | cannot assign to this expression
43
73
|
44
- help: you might have meant to use pattern matching
74
+ = note: see issue #71126 <https://github.com/rust-lang/rust/issues/71126> for more information
75
+ = help: add `#![feature(destructuring_assignment)]` to the crate attributes to enable
76
+
77
+ error[E0070]: invalid left-hand side of assignment
78
+ --> $DIR/if-let-typo.rs:11:16
45
79
|
46
- LL | if let Some(3) = foo {}
47
- | ^^^
48
- help: you might have meant to compare for equality
80
+ LL | if Some(3) = foo {}
81
+ | - ^
82
+ | |
83
+ | cannot assign to this expression
84
+
85
+ error[E0308]: mismatched types
86
+ --> $DIR/if-let-typo.rs:11:8
49
87
|
50
- LL | if Some(3) == foo {}
51
- | ^^
88
+ LL | if Some(3) = foo {}
89
+ | ^^^^^^^^^^^^^ expected `bool`, found `()`
52
90
53
- error: aborting due to 4 previous errors
91
+ error: aborting due to 10 previous errors
54
92
55
- Some errors have detailed explanations: E0308, E0425.
56
- For more information about an error, try `rustc --explain E0308 `.
93
+ Some errors have detailed explanations: E0070, E0308, E0425, E0658 .
94
+ For more information about an error, try `rustc --explain E0070 `.
0 commit comments