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