fork/rust

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

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

master
2.7 KiB72 linesraw
1error[E0409]: variable `i` is bound inconsistently across alternatives separated by `|`
2  --> $DIR/resolve-inconsistent-binding-mode.rs:9:34
3   |
4LL |         Opts::A(ref i) | Opts::B(i) => {}
5   |                     -            ^ bound in different ways
6   |                     |
7   |                     first binding
8
9error[E0409]: variable `i` is bound inconsistently across alternatives separated by `|`
10  --> $DIR/resolve-inconsistent-binding-mode.rs:18:34
11   |
12LL |         Opts::A(ref i) | Opts::B(i) => {}
13   |                     -            ^ bound in different ways
14   |                     |
15   |                     first binding
16
17error[E0409]: variable `i` is bound inconsistently across alternatives separated by `|`
18  --> $DIR/resolve-inconsistent-binding-mode.rs:27:42
19   |
20LL |         Opts::A(ref mut i) | Opts::B(ref i) => {}
21   |                         - first binding  ^ bound in different ways
22
23error[E0308]: mismatched types
24  --> $DIR/resolve-inconsistent-binding-mode.rs:9:34
25   |
26LL |     match x {
27   |           - this expression has type `Opts`
28LL |         Opts::A(ref i) | Opts::B(i) => {}
29   |                 -----            ^ expected `&isize`, found `isize`
30   |                 |
31   |                 first introduced with type `&isize` here
32   |
33   = note: in the same arm, a binding must have the same type in all alternatives
34help: consider adding `ref`
35   |
36LL |         Opts::A(ref i) | Opts::B(ref i) => {}
37   |                                  +++
38
39error[E0308]: mismatched types
40  --> $DIR/resolve-inconsistent-binding-mode.rs:18:34
41   |
42LL |     match x {
43   |           - this expression has type `Opts`
44LL |         Opts::A(ref i) | Opts::B(i) => {}
45   |                 -----            ^ expected `&isize`, found `isize`
46   |                 |
47   |                 first introduced with type `&isize` here
48   |
49   = note: in the same arm, a binding must have the same type in all alternatives
50help: consider adding `ref`
51   |
52LL |         Opts::A(ref i) | Opts::B(ref i) => {}
53   |                                  +++
54
55error[E0308]: mismatched types
56  --> $DIR/resolve-inconsistent-binding-mode.rs:27:38
57   |
58LL |     match x {
59   |           - this expression has type `Opts`
60LL |         Opts::A(ref mut i) | Opts::B(ref i) => {}
61   |                 ---------            ^^^^^ types differ in mutability
62   |                 |
63   |                 first introduced with type `&mut isize` here
64   |
65   = note: expected mutable reference `&mut isize`
66                      found reference `&isize`
67   = note: in the same arm, a binding must have the same type in all alternatives
68
69error: aborting due to 6 previous errors
70
71Some errors have detailed explanations: E0308, E0409.
72For more information about an error, try `rustc --explain E0308`.