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