summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/collapsible_match2.stderr
blob: 144dbe40a7ad61b62ade621cea2318460449d3ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
error: this `match` can be collapsed into the outer `match`
  --> $DIR/collapsible_match2.rs:13:34
   |
LL |               Ok(val) if make() => match val {
   |  __________________________________^
LL | |                 Some(n) => foo(n),
LL | |                 _ => return,
LL | |             },
   | |_____________^
   |
help: the outer pattern can be modified to include the inner pattern
  --> $DIR/collapsible_match2.rs:13:16
   |
LL |             Ok(val) if make() => match val {
   |                ^^^ replace this binding
LL |                 Some(n) => foo(n),
   |                 ^^^^^^^ with this pattern
   = note: `-D clippy::collapsible-match` implied by `-D warnings`

error: this `match` can be collapsed into the outer `match`
  --> $DIR/collapsible_match2.rs:20:24
   |
LL |               Ok(val) => match val {
   |  ________________________^
LL | |                 Some(n) => foo(n),
LL | |                 _ => return,
LL | |             },
   | |_____________^
   |
help: the outer pattern can be modified to include the inner pattern
  --> $DIR/collapsible_match2.rs:20:16
   |
LL |             Ok(val) => match val {
   |                ^^^ replace this binding
LL |                 Some(n) => foo(n),
   |                 ^^^^^^^ with this pattern

error: this `match` can be collapsed into the outer `match`
  --> $DIR/collapsible_match2.rs:34:29
   |
LL |                       $pat => match $e {
   |  _____________________________^
LL | |                         $inner_pat => $then,
LL | |                         _ => return,
LL | |                     },
   | |_____________________^
...
LL |           mac!(res_opt => Ok(val), val => Some(n), foo(n));
   |           ------------------------------------------------ in this macro invocation
   |
help: the outer pattern can be modified to include the inner pattern
  --> $DIR/collapsible_match2.rs:46:28
   |
LL |         mac!(res_opt => Ok(val), val => Some(n), foo(n));
   |                            ^^^          ^^^^^^^ with this pattern
   |                            |
   |                            replace this binding
   = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)

error: this `match` can be collapsed into the outer `match`
  --> $DIR/collapsible_match2.rs:51:20
   |
LL |           Some(s) => match *s {
   |  ____________________^
LL | |             [n] => foo(n),
LL | |             _ => (),
LL | |         },
   | |_________^
   |
help: the outer pattern can be modified to include the inner pattern
  --> $DIR/collapsible_match2.rs:51:14
   |
LL |         Some(s) => match *s {
   |              ^ replace this binding
LL |             [n] => foo(n),
   |             ^^^ with this pattern

error: this `match` can be collapsed into the outer `match`
  --> $DIR/collapsible_match2.rs:60:24
   |
LL |           Some(ref s) => match s {
   |  ________________________^
LL | |             [n] => foo(n),
LL | |             _ => (),
LL | |         },
   | |_________^
   |
help: the outer pattern can be modified to include the inner pattern
  --> $DIR/collapsible_match2.rs:60:14
   |
LL |         Some(ref s) => match s {
   |              ^^^^^ replace this binding
LL |             [n] => foo(n),
   |             ^^^ with this pattern

error: aborting due to 5 previous errors