]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/match-ergonomics.stderr
Rollup merge of #90420 - GuillaumeGomez:rustdoc-internals-feature, r=camelid
[rust.git] / src / test / 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    |          ^^
8    |          |
9    |          expected `i32`, found reference
10    |          help: you can probably remove the explicit borrow: `v`
11    |
12    = note:   expected type `i32`
13            found reference `&_`
14
15 error[E0529]: expected an array or slice, found `Vec<i32>`
16   --> $DIR/match-ergonomics.rs:8:9
17    |
18 LL |     match x {
19    |           - help: consider slicing here: `x[..]`
20 LL |         [&v] => {},
21    |         ^^^^ pattern cannot match with input type `Vec<i32>`
22
23 error[E0529]: expected an array or slice, found `Vec<i32>`
24   --> $DIR/match-ergonomics.rs:20:9
25    |
26 LL |     match x {
27    |           - help: consider slicing here: `x[..]`
28 LL |         [v] => {},
29    |         ^^^ pattern cannot match with input type `Vec<i32>`
30
31 error[E0308]: mismatched types
32   --> $DIR/match-ergonomics.rs:29:9
33    |
34 LL |     match y {
35    |           - this expression has type `i32`
36 LL |         &v => {},
37    |         ^^
38    |         |
39    |         expected `i32`, found reference
40    |         help: you can probably remove the explicit borrow: `v`
41    |
42    = note:   expected type `i32`
43            found reference `&_`
44
45 error[E0308]: mismatched types
46   --> $DIR/match-ergonomics.rs:40:13
47    |
48 LL |     if let [&v] = &x[..] {}
49    |             ^^    ------ this expression has type `&[i32]`
50    |             |
51    |             expected `i32`, found reference
52    |             help: you can probably remove the explicit borrow: `v`
53    |
54    = note:   expected type `i32`
55            found reference `&_`
56
57 error: aborting due to 5 previous errors
58
59 Some errors have detailed explanations: E0308, E0529.
60 For more information about an error, try `rustc --explain E0308`.