fork/rust

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

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

master
3.6 KiB104 linesraw
1error[E0408]: variable `b` is not bound in all patterns
2  --> $DIR/resolve-inconsistent-names.rs:13:8
3   |
4LL |        a | b => {}
5   |        ^   - variable not in all patterns
6   |        |
7   |        pattern doesn't bind `b`
8
9error[E0408]: variable `a` is not bound in all patterns
10  --> $DIR/resolve-inconsistent-names.rs:13:12
11   |
12LL |        a | b => {}
13   |        -   ^ pattern doesn't bind `a`
14   |        |
15   |        variable not in all patterns
16
17error[E0408]: variable `c` is not bound in all patterns
18  --> $DIR/resolve-inconsistent-names.rs:19:9
19   |
20LL |         (A, B) | (ref B, c) | (c, A) => ()
21   |         ^^^^^^           -     - variable not in all patterns
22   |         |                |
23   |         |                variable not in all patterns
24   |         pattern doesn't bind `c`
25
26error[E0408]: variable `A` is not bound in all patterns
27  --> $DIR/resolve-inconsistent-names.rs:19:18
28   |
29LL |         (A, B) | (ref B, c) | (c, A) => ()
30   |          -       ^^^^^^^^^^       - variable not in all patterns
31   |          |       |
32   |          |       pattern doesn't bind `A`
33   |          variable not in all patterns
34   |
35help: if you meant to match on unit variant `E::A`, use the full path in the pattern
36   |
37LL |         (E::A, B) | (ref B, c) | (c, A) => ()
38   |          ~~~~
39
40error[E0408]: variable `B` is not bound in all patterns
41  --> $DIR/resolve-inconsistent-names.rs:19:31
42   |
43LL |         (A, B) | (ref B, c) | (c, A) => ()
44   |             -         -       ^^^^^^ pattern doesn't bind `B`
45   |             |         |
46   |             |         variable not in all patterns
47   |             variable not in all patterns
48
49error[E0409]: variable `B` is bound inconsistently across alternatives separated by `|`
50  --> $DIR/resolve-inconsistent-names.rs:19:23
51   |
52LL |         (A, B) | (ref B, c) | (c, A) => ()
53   |             -         ^ bound in different ways
54   |             |
55   |             first binding
56
57error[E0408]: variable `Const2` is not bound in all patterns
58  --> $DIR/resolve-inconsistent-names.rs:31:9
59   |
60LL |         (CONST1, _) | (_, Const2) => ()
61   |         ^^^^^^^^^^^       ------ variable not in all patterns
62   |         |
63   |         pattern doesn't bind `Const2`
64   |
65help: if you meant to match on constant `m::Const2`, use the full path in the pattern
66   |
67LL |         (CONST1, _) | (_, m::Const2) => ()
68   |                           ~~~~~~~~~
69
70error[E0408]: variable `CONST1` is not bound in all patterns
71  --> $DIR/resolve-inconsistent-names.rs:31:23
72   |
73LL |         (CONST1, _) | (_, Const2) => ()
74   |          ------       ^^^^^^^^^^^ pattern doesn't bind `CONST1`
75   |          |
76   |          variable not in all patterns
77   |
78note: you might have meant to match on constant `m::CONST1`, which exists but is inaccessible
79  --> $DIR/resolve-inconsistent-names.rs:6:5
80   |
81LL |     const CONST1: usize = 10;
82   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ not accessible
83
84error[E0308]: mismatched types
85  --> $DIR/resolve-inconsistent-names.rs:19:19
86   |
87LL |     match x {
88   |           - this expression has type `(E, E)`
89LL |         (A, B) | (ref B, c) | (c, A) => ()
90   |             -     ^^^^^ expected `E`, found `&E`
91   |             |
92   |             first introduced with type `E` here
93   |
94   = note: in the same arm, a binding must have the same type in all alternatives
95help: consider removing `ref`
96   |
97LL -         (A, B) | (ref B, c) | (c, A) => ()
98LL +         (A, B) | (B, c) | (c, A) => ()
99   |
100
101error: aborting due to 9 previous errors
102
103Some errors have detailed explanations: E0308, E0408, E0409.
104For more information about an error, try `rustc --explain E0308`.