@@ -9,23 +9,51 @@ help: you might have meant to use pattern matching
99LL | if let Some(x) = foo {}
1010 | ^^^
1111
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+
1223error[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
1431 |
1532LL | if Some(foo) = bar {}
16- | ^^^^^^^^^^^^^^^ expected `bool`, found `()`
33+ | --------- ^
34+ | |
35+ | cannot assign to this expression
1736 |
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
1942 |
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`
2351 |
24- LL | if Some(foo) == bar {}
25- | ^^
52+ = note: expected type `{integer}`
53+ found enum `Option<{integer}>`
2654
2755error[E0308]: mismatched types
28- --> $DIR/if-let-typo.rs:6 :8
56+ --> $DIR/if-let-typo.rs:9 :8
2957 |
3058LL | if 3 = foo {}
3159 | ^^^^^^^ expected `bool`, found `()`
@@ -35,22 +63,32 @@ help: you might have meant to use pattern matching
3563LL | if let 3 = foo {}
3664 | ^^^
3765
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
4068 |
4169LL | if Some(3) = foo {}
42- | ^^^^^^^^^^^^^ expected `bool`, found `()`
70+ | ------- ^
71+ | |
72+ | cannot assign to this expression
4373 |
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
4579 |
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
4987 |
50- LL | if Some(3) == foo {}
51- | ^^
88+ LL | if Some(3) = foo {}
89+ | ^^^^^^^^^^^^^ expected `bool`, found `()`
5290
53- error: aborting due to 4 previous errors
91+ error: aborting due to 10 previous errors
5492
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