]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/match-ergonomics.stderr
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / match-ergonomics.stderr
1 error[E0308]: mismatched types
2   --> $DIR/match-ergonomics.rs:4:10
3    |
4 LL |     match &x[..] {
5    |           ------ this expression has type `&[i32]`
6 LL |         [&v] => {},
7    |          ^^ expected `i32`, found reference
8    |
9    = note:   expected type `i32`
10            found reference `&_`
11 help: consider removing `&` from the pattern
12    |
13 LL -         [&v] => {},
14 LL +         [v] => {},
15    |
16
17 error[E0529]: expected an array or slice, found `Vec<i32>`
18   --> $DIR/match-ergonomics.rs:8:9
19    |
20 LL |     match x {
21    |           - help: consider slicing here: `x[..]`
22 LL |         [&v] => {},
23    |         ^^^^ pattern cannot match with input type `Vec<i32>`
24
25 error[E0529]: expected an array or slice, found `Vec<i32>`
26   --> $DIR/match-ergonomics.rs:20:9
27    |
28 LL |     match x {
29    |           - help: consider slicing here: `x[..]`
30 LL |         [v] => {},
31    |         ^^^ pattern cannot match with input type `Vec<i32>`
32
33 error[E0308]: mismatched types
34   --> $DIR/match-ergonomics.rs:29:9
35    |
36 LL |     match y {
37    |           - this expression has type `i32`
38 LL |         &v => {},
39    |         ^^ expected `i32`, found reference
40    |
41    = note:   expected type `i32`
42            found reference `&_`
43 help: consider removing `&` from the pattern
44    |
45 LL -         &v => {},
46 LL +         v => {},
47    |
48
49 error[E0308]: mismatched types
50   --> $DIR/match-ergonomics.rs:40:13
51    |
52 LL |     if let [&v] = &x[..] {}
53    |             ^^    ------ this expression has type `&[i32]`
54    |             |
55    |             expected `i32`, found reference
56    |
57    = note:   expected type `i32`
58            found reference `&_`
59 help: consider removing `&` from the pattern
60    |
61 LL -     if let [&v] = &x[..] {}
62 LL +     if let [v] = &x[..] {}
63    |
64
65 error: aborting due to 5 previous errors
66
67 Some errors have detailed explanations: E0308, E0529.
68 For more information about an error, try `rustc --explain E0308`.