fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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