2019-04-29 21:16:35 -05:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/match-ergonomics.rs:4:10
|
|
|
|
|
|
2020-02-24 22:53:21 -06:00
|
|
|
LL | match &x[..] {
|
|
|
|
| ------ this expression has type `&[i32]`
|
2019-04-29 21:16:35 -05:00
|
|
|
LL | [&v] => {},
|
2023-01-02 20:00:33 -06:00
|
|
|
| ^^ expected `i32`, found `&_`
|
2019-04-29 21:16:35 -05:00
|
|
|
|
|
2019-11-13 16:16:56 -06:00
|
|
|
= note: expected type `i32`
|
|
|
|
found reference `&_`
|
2022-06-10 14:18:42 -05:00
|
|
|
help: consider removing `&` from the pattern
|
|
|
|
|
|
|
|
|
LL - [&v] => {},
|
|
|
|
LL + [v] => {},
|
2022-06-15 06:15:54 -05:00
|
|
|
|
|
2019-04-29 21:16:35 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error[E0529]: expected an array or slice, found `Vec<i32>`
|
2019-04-29 21:16:35 -05:00
|
|
|
--> $DIR/match-ergonomics.rs:8:9
|
|
|
|
|
|
2021-07-10 12:54:48 -05:00
|
|
|
LL | match x {
|
|
|
|
| - help: consider slicing here: `x[..]`
|
2019-04-29 21:16:35 -05:00
|
|
|
LL | [&v] => {},
|
2020-09-02 02:40:56 -05:00
|
|
|
| ^^^^ pattern cannot match with input type `Vec<i32>`
|
2019-04-29 21:16:35 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error[E0529]: expected an array or slice, found `Vec<i32>`
|
2019-04-29 21:16:35 -05:00
|
|
|
--> $DIR/match-ergonomics.rs:20:9
|
|
|
|
|
|
2021-07-10 12:54:48 -05:00
|
|
|
LL | match x {
|
|
|
|
| - help: consider slicing here: `x[..]`
|
2019-04-29 21:16:35 -05:00
|
|
|
LL | [v] => {},
|
2020-09-02 02:40:56 -05:00
|
|
|
| ^^^ pattern cannot match with input type `Vec<i32>`
|
2019-04-29 21:16:35 -05:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/match-ergonomics.rs:29:9
|
|
|
|
|
|
2020-02-24 22:53:21 -06:00
|
|
|
LL | match y {
|
|
|
|
| - this expression has type `i32`
|
2019-04-29 21:16:35 -05:00
|
|
|
LL | &v => {},
|
2023-01-02 20:00:33 -06:00
|
|
|
| ^^ expected `i32`, found `&_`
|
2019-04-29 21:16:35 -05:00
|
|
|
|
|
2019-11-13 16:16:56 -06:00
|
|
|
= note: expected type `i32`
|
|
|
|
found reference `&_`
|
2022-06-10 14:18:42 -05:00
|
|
|
help: consider removing `&` from the pattern
|
|
|
|
|
|
|
|
|
LL - &v => {},
|
|
|
|
LL + v => {},
|
2022-06-15 06:15:54 -05:00
|
|
|
|
|
2019-04-29 21:16:35 -05:00
|
|
|
|
2019-04-29 22:58:29 -05:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/match-ergonomics.rs:40:13
|
|
|
|
|
|
|
|
|
LL | if let [&v] = &x[..] {}
|
2020-02-24 22:53:21 -06:00
|
|
|
| ^^ ------ this expression has type `&[i32]`
|
2019-04-29 22:58:29 -05:00
|
|
|
| |
|
2023-01-02 20:00:33 -06:00
|
|
|
| expected `i32`, found `&_`
|
2019-04-29 22:58:29 -05:00
|
|
|
|
|
2019-11-13 16:16:56 -06:00
|
|
|
= note: expected type `i32`
|
|
|
|
found reference `&_`
|
2022-06-10 14:18:42 -05:00
|
|
|
help: consider removing `&` from the pattern
|
|
|
|
|
|
|
|
|
LL - if let [&v] = &x[..] {}
|
|
|
|
LL + if let [v] = &x[..] {}
|
2022-06-15 06:15:54 -05:00
|
|
|
|
|
2019-04-29 22:58:29 -05:00
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
2019-04-29 21:16:35 -05:00
|
|
|
|
|
|
|
Some errors have detailed explanations: E0308, E0529.
|
|
|
|
For more information about an error, try `rustc --explain E0308`.
|