summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/match-ergonomics.stderr
blob: a3e059e8ac646191c2daf56708b0a85d8465791f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
error[E0308]: mismatched types
  --> $DIR/match-ergonomics.rs:4:10
   |
LL |     match &x[..] {
   |           ------ this expression has type `&[i32]`
LL |         [&v] => {},
   |          ^^ expected `i32`, found `&_`
   |
   = note:   expected type `i32`
           found reference `&_`
help: consider removing `&` from the pattern
   |
LL -         [&v] => {},
LL +         [v] => {},
   |

error[E0529]: expected an array or slice, found `Vec<i32>`
  --> $DIR/match-ergonomics.rs:8:9
   |
LL |     match x {
   |           - help: consider slicing here: `x[..]`
LL |         [&v] => {},
   |         ^^^^ pattern cannot match with input type `Vec<i32>`

error[E0529]: expected an array or slice, found `Vec<i32>`
  --> $DIR/match-ergonomics.rs:20:9
   |
LL |     match x {
   |           - help: consider slicing here: `x[..]`
LL |         [v] => {},
   |         ^^^ pattern cannot match with input type `Vec<i32>`

error[E0308]: mismatched types
  --> $DIR/match-ergonomics.rs:29:9
   |
LL |     match y {
   |           - this expression has type `i32`
LL |         &v => {},
   |         ^^ expected `i32`, found `&_`
   |
   = note:   expected type `i32`
           found reference `&_`
help: consider removing `&` from the pattern
   |
LL -         &v => {},
LL +         v => {},
   |

error[E0308]: mismatched types
  --> $DIR/match-ergonomics.rs:40:13
   |
LL |     if let [&v] = &x[..] {}
   |             ^^    ------ this expression has type `&[i32]`
   |             |
   |             expected `i32`, found `&_`
   |
   = note:   expected type `i32`
           found reference `&_`
help: consider removing `&` from the pattern
   |
LL -     if let [&v] = &x[..] {}
LL +     if let [v] = &x[..] {}
   |

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0308, E0529.
For more information about an error, try `rustc --explain E0308`.