File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -37,4 +37,5 @@ fn main() {
37
37
v => { } ,
38
38
_ => { } ,
39
39
}
40
+ if let [ & v] = & x[ ..] { } //~ ERROR mismatched types
40
41
}
Original file line number Diff line number Diff line change @@ -35,7 +35,19 @@ help: you can rely on match ergonomics and remove the explicit borrow
35
35
LL | v => {},
36
36
| ^
37
37
38
- error: aborting due to 4 previous errors
38
+ error[E0308]: mismatched types
39
+ --> $DIR/match-ergonomics.rs:40:13
40
+ |
41
+ LL | if let [&v] = &x[..] {}
42
+ | ^^
43
+ | |
44
+ | expected i32, found reference
45
+ | help: you can probably remove the explicit borrow: `v`
46
+ |
47
+ = note: expected type `i32`
48
+ found type `&_`
49
+
50
+ error: aborting due to 5 previous errors
39
51
40
52
Some errors have detailed explanations: E0308, E0529.
41
53
For more information about an error, try `rustc --explain E0308`.
You can’t perform that action at this time.
0 commit comments