fork/rust

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

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

master
3.4 KiB106 linesraw
1error: this `match` can be collapsed into the outer `match`
2  --> $DIR/collapsible_match2.rs:13:34
3   |
4LL |               Ok(val) if make() => match val {
5   |  __________________________________^
6LL | |
7LL | |                 Some(n) => foo(n),
8LL | |                 _ => return,
9LL | |             },
10   | |_____________^
11   |
12help: the outer pattern can be modified to include the inner pattern
13  --> $DIR/collapsible_match2.rs:13:16
14   |
15LL |             Ok(val) if make() => match val {
16   |                ^^^ replace this binding
17LL |
18LL |                 Some(n) => foo(n),
19   |                 ^^^^^^^ with this pattern
20   = note: `-D clippy::collapsible-match` implied by `-D warnings`
21   = help: to override `-D warnings` add `#[allow(clippy::collapsible_match)]`
22
23error: this `match` can be collapsed into the outer `match`
24  --> $DIR/collapsible_match2.rs:21:24
25   |
26LL |               Ok(val) => match val {
27   |  ________________________^
28LL | |
29LL | |                 Some(n) => foo(n),
30LL | |                 _ => return,
31LL | |             },
32   | |_____________^
33   |
34help: the outer pattern can be modified to include the inner pattern
35  --> $DIR/collapsible_match2.rs:21:16
36   |
37LL |             Ok(val) => match val {
38   |                ^^^ replace this binding
39LL |
40LL |                 Some(n) => foo(n),
41   |                 ^^^^^^^ with this pattern
42
43error: this `match` can be collapsed into the outer `match`
44  --> $DIR/collapsible_match2.rs:36:29
45   |
46LL |                       $pat => match $e {
47   |  _____________________________^
48LL | |                         $inner_pat => $then,
49LL | |                         _ => return,
50LL | |                     },
51   | |_____________________^
52...
53LL |           mac!(res_opt => Ok(val), val => Some(n), foo(n));
54   |           ------------------------------------------------ in this macro invocation
55   |
56help: the outer pattern can be modified to include the inner pattern
57  --> $DIR/collapsible_match2.rs:48:28
58   |
59LL |         mac!(res_opt => Ok(val), val => Some(n), foo(n));
60   |                            ^^^          ^^^^^^^ with this pattern
61   |                            |
62   |                            replace this binding
63   = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
64
65error: this `match` can be collapsed into the outer `match`
66  --> $DIR/collapsible_match2.rs:53:20
67   |
68LL |           Some(s) => match *s {
69   |  ____________________^
70LL | |
71LL | |             [n] => foo(n),
72LL | |             _ => (),
73LL | |         },
74   | |_________^
75   |
76help: the outer pattern can be modified to include the inner pattern
77  --> $DIR/collapsible_match2.rs:53:14
78   |
79LL |         Some(s) => match *s {
80   |              ^ replace this binding
81LL |
82LL |             [n] => foo(n),
83   |             ^^^ with this pattern
84
85error: this `match` can be collapsed into the outer `match`
86  --> $DIR/collapsible_match2.rs:63:24
87   |
88LL |           Some(ref s) => match s {
89   |  ________________________^
90LL | |
91LL | |             [n] => foo(n),
92LL | |             _ => (),
93LL | |         },
94   | |_________^
95   |
96help: the outer pattern can be modified to include the inner pattern
97  --> $DIR/collapsible_match2.rs:63:14
98   |
99LL |         Some(ref s) => match s {
100   |              ^^^^^ replace this binding
101LL |
102LL |             [n] => foo(n),
103   |             ^^^ with this pattern
104
105error: aborting due to 5 previous errors
106