rust/tests/ui/suggestions/match-ergonomics.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

69 lines
1.8 KiB
Plaintext
Raw Normal View History

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] => {},
| ^^ expected `i32`, found `&_`
2019-04-30 02:16:35 +00:00
|
= note: expected type `i32`
found reference `&_`
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
error[E0529]: expected an array or slice, found `Vec<i32>`
2019-04-30 02:16:35 +00:00
--> $DIR/match-ergonomics.rs:8:9
|
LL | match x {
| - help: consider slicing here: `x[..]`
2019-04-30 02:16:35 +00:00
LL | [&v] => {},
| ^^^^ pattern cannot match with input type `Vec<i32>`
2019-04-30 02:16:35 +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
|
LL | match x {
| - help: consider slicing here: `x[..]`
2019-04-30 02:16:35 +00:00
LL | [v] => {},
| ^^^ 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 => {},
| ^^ expected `i32`, found `&_`
2019-04-30 02:16:35 +00:00
|
= note: expected type `i32`
found reference `&_`
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
| |
| expected `i32`, found `&_`
2019-04-30 03:58:29 +00:00
|
= note: expected type `i32`
found reference `&_`
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`.