]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/collapsible_match2.stderr
Merge commit 'c1664c50b27a51f7a78c93ba65558e7c33eabee6' into clippyup
[rust.git] / src / tools / clippy / tests / ui / collapsible_match2.stderr
1 error: Unnecessary nested match
2   --> $DIR/collapsible_match2.rs:8: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:8: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: Unnecessary nested match
21   --> $DIR/collapsible_match2.rs:15: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:15: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: Unnecessary nested match
39   --> $DIR/collapsible_match2.rs:29: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:41: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 a macro (in Nightly builds, run with -Z macro-backtrace for more info)
59
60 error: aborting due to 3 previous errors
61