fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
1.5 KiB52 linesraw
1error[E0308]: mismatched types
2  --> $DIR/match-ergonomics.rs:4:10
3   |
4LL |         [&v] => {},
5   |          ^^
6   |          |
7   |          expected i32, found reference
8   |          help: you can probably remove the explicit borrow: `v`
9   |
10   = note: expected type `i32`
11              found type `&_`
12
13error[E0529]: expected an array or slice, found `std::vec::Vec<i32>`
14  --> $DIR/match-ergonomics.rs:8:9
15   |
16LL |         [&v] => {},
17   |         ^^^^ pattern cannot match with input type `std::vec::Vec<i32>`
18
19error[E0529]: expected an array or slice, found `std::vec::Vec<i32>`
20  --> $DIR/match-ergonomics.rs:20:9
21   |
22LL |         [v] => {},
23   |         ^^^ pattern cannot match with input type `std::vec::Vec<i32>`
24
25error[E0308]: mismatched types
26  --> $DIR/match-ergonomics.rs:29:9
27   |
28LL |         &v => {},
29   |         ^^
30   |         |
31   |         expected i32, found reference
32   |         help: you can probably remove the explicit borrow: `v`
33   |
34   = note: expected type `i32`
35              found type `&_`
36
37error[E0308]: mismatched types
38  --> $DIR/match-ergonomics.rs:40:13
39   |
40LL |     if let [&v] = &x[..] {}
41   |             ^^
42   |             |
43   |             expected i32, found reference
44   |             help: you can probably remove the explicit borrow: `v`
45   |
46   = note: expected type `i32`
47              found type `&_`
48
49error: aborting due to 5 previous errors
50
51Some errors have detailed explanations: E0308, E0529.
52For more information about an error, try `rustc --explain E0308`.