|
1 |
| -error: this `match` has identical arm bodies |
2 |
| - --> $DIR/match_same_arms.rs:13:14 |
| 1 | +error: this match arm has an identical body to the `_` wildcard arm |
| 2 | + --> $DIR/match_same_arms.rs:11:9 |
3 | 3 | |
|
4 |
| -LL | _ => 0, //~ ERROR match arms have same body |
5 |
| - | ^ |
| 4 | +LL | Abc::A => 0, |
| 5 | + | ^^^^^^^^^^^ help: try removing the arm |
6 | 6 | |
|
7 | 7 | = note: `-D clippy::match-same-arms` implied by `-D warnings`
|
8 |
| -note: same as this |
9 |
| - --> $DIR/match_same_arms.rs:11:19 |
| 8 | + = help: or try changing either arm body |
| 9 | +note: `_` wildcard arm here |
| 10 | + --> $DIR/match_same_arms.rs:13:9 |
10 | 11 | |
|
11 |
| -LL | Abc::A => 0, |
12 |
| - | ^ |
13 |
| -note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it |
14 |
| - --> $DIR/match_same_arms.rs:11:19 |
15 |
| - | |
16 |
| -LL | Abc::A => 0, |
17 |
| - | ^ |
| 12 | +LL | _ => 0, //~ ERROR match arms have same body |
| 13 | + | ^^^^^^ |
18 | 14 |
|
19 |
| -error: this `match` has identical arm bodies |
20 |
| - --> $DIR/match_same_arms.rs:18:20 |
21 |
| - | |
22 |
| -LL | (.., 3) => 42, //~ ERROR match arms have same body |
23 |
| - | ^^ |
24 |
| - | |
25 |
| -note: same as this |
26 |
| - --> $DIR/match_same_arms.rs:17:23 |
27 |
| - | |
28 |
| -LL | (1, .., 3) => 42, |
29 |
| - | ^^ |
30 |
| -help: consider refactoring into `(1, .., 3) | (.., 3)` |
| 15 | +error: this match arm has an identical body to another arm |
31 | 16 | --> $DIR/match_same_arms.rs:17:9
|
32 | 17 | |
|
33 | 18 | LL | (1, .., 3) => 42,
|
34 |
| - | ^^^^^^^^^^ |
35 |
| - = help: ...or consider changing the match arm bodies |
| 19 | + | ----------^^^^^^ |
| 20 | + | | |
| 21 | + | help: try merging the arm patterns: `(1, .., 3) | (.., 3)` |
| 22 | + | |
| 23 | + = help: or try changing either arm body |
| 24 | +note: other arm here |
| 25 | + --> $DIR/match_same_arms.rs:18:9 |
| 26 | + | |
| 27 | +LL | (.., 3) => 42, //~ ERROR match arms have same body |
| 28 | + | ^^^^^^^^^^^^^ |
36 | 29 |
|
37 |
| -error: this `match` has identical arm bodies |
38 |
| - --> $DIR/match_same_arms.rs:24:15 |
| 30 | +error: this match arm has an identical body to another arm |
| 31 | + --> $DIR/match_same_arms.rs:24:9 |
39 | 32 | |
|
40 | 33 | LL | 51 => 1, //~ ERROR match arms have same body
|
41 |
| - | ^ |
| 34 | + | --^^^^^ |
| 35 | + | | |
| 36 | + | help: try merging the arm patterns: `51 | 42` |
42 | 37 | |
|
43 |
| -note: same as this |
44 |
| - --> $DIR/match_same_arms.rs:23:15 |
45 |
| - | |
46 |
| -LL | 42 => 1, |
47 |
| - | ^ |
48 |
| -help: consider refactoring into `42 | 51` |
| 38 | + = help: or try changing either arm body |
| 39 | +note: other arm here |
49 | 40 | --> $DIR/match_same_arms.rs:23:9
|
50 | 41 | |
|
51 | 42 | LL | 42 => 1,
|
52 |
| - | ^^ |
53 |
| - = help: ...or consider changing the match arm bodies |
| 43 | + | ^^^^^^^ |
54 | 44 |
|
55 |
| -error: this `match` has identical arm bodies |
56 |
| - --> $DIR/match_same_arms.rs:26:15 |
57 |
| - | |
58 |
| -LL | 52 => 2, //~ ERROR match arms have same body |
59 |
| - | ^ |
60 |
| - | |
61 |
| -note: same as this |
62 |
| - --> $DIR/match_same_arms.rs:25:15 |
63 |
| - | |
64 |
| -LL | 41 => 2, |
65 |
| - | ^ |
66 |
| -help: consider refactoring into `41 | 52` |
| 45 | +error: this match arm has an identical body to another arm |
67 | 46 | --> $DIR/match_same_arms.rs:25:9
|
68 | 47 | |
|
69 | 48 | LL | 41 => 2,
|
70 |
| - | ^^ |
71 |
| - = help: ...or consider changing the match arm bodies |
| 49 | + | --^^^^^ |
| 50 | + | | |
| 51 | + | help: try merging the arm patterns: `41 | 52` |
| 52 | + | |
| 53 | + = help: or try changing either arm body |
| 54 | +note: other arm here |
| 55 | + --> $DIR/match_same_arms.rs:26:9 |
| 56 | + | |
| 57 | +LL | 52 => 2, //~ ERROR match arms have same body |
| 58 | + | ^^^^^^^ |
72 | 59 |
|
73 |
| -error: this `match` has identical arm bodies |
74 |
| - --> $DIR/match_same_arms.rs:32:14 |
| 60 | +error: this match arm has an identical body to another arm |
| 61 | + --> $DIR/match_same_arms.rs:32:9 |
75 | 62 | |
|
76 | 63 | LL | 2 => 2, //~ ERROR 2nd matched arms have same body
|
77 |
| - | ^ |
78 |
| - | |
79 |
| -note: same as this |
80 |
| - --> $DIR/match_same_arms.rs:31:14 |
| 64 | + | -^^^^^ |
| 65 | + | | |
| 66 | + | help: try merging the arm patterns: `2 | 1` |
81 | 67 | |
|
82 |
| -LL | 1 => 2, |
83 |
| - | ^ |
84 |
| -help: consider refactoring into `1 | 2` |
| 68 | + = help: or try changing either arm body |
| 69 | +note: other arm here |
85 | 70 | --> $DIR/match_same_arms.rs:31:9
|
86 | 71 | |
|
87 | 72 | LL | 1 => 2,
|
88 |
| - | ^ |
89 |
| - = help: ...or consider changing the match arm bodies |
| 73 | + | ^^^^^^ |
90 | 74 |
|
91 |
| -error: this `match` has identical arm bodies |
92 |
| - --> $DIR/match_same_arms.rs:33:14 |
| 75 | +error: this match arm has an identical body to another arm |
| 76 | + --> $DIR/match_same_arms.rs:33:9 |
93 | 77 | |
|
94 | 78 | LL | 3 => 2, //~ ERROR 3rd matched arms have same body
|
95 |
| - | ^ |
96 |
| - | |
97 |
| -note: same as this |
98 |
| - --> $DIR/match_same_arms.rs:31:14 |
| 79 | + | -^^^^^ |
| 80 | + | | |
| 81 | + | help: try merging the arm patterns: `3 | 1` |
99 | 82 | |
|
100 |
| -LL | 1 => 2, |
101 |
| - | ^ |
102 |
| -help: consider refactoring into `1 | 3` |
| 83 | + = help: or try changing either arm body |
| 84 | +note: other arm here |
103 | 85 | --> $DIR/match_same_arms.rs:31:9
|
104 | 86 | |
|
105 | 87 | LL | 1 => 2,
|
106 |
| - | ^ |
107 |
| - = help: ...or consider changing the match arm bodies |
| 88 | + | ^^^^^^ |
108 | 89 |
|
109 |
| -error: this `match` has identical arm bodies |
110 |
| - --> $DIR/match_same_arms.rs:50:55 |
| 90 | +error: this match arm has an identical body to another arm |
| 91 | + --> $DIR/match_same_arms.rs:32:9 |
111 | 92 | |
|
112 |
| -LL | CommandInfo::External { name, .. } => name.to_string(), |
113 |
| - | ^^^^^^^^^^^^^^^^ |
| 93 | +LL | 2 => 2, //~ ERROR 2nd matched arms have same body |
| 94 | + | -^^^^^ |
| 95 | + | | |
| 96 | + | help: try merging the arm patterns: `2 | 3` |
114 | 97 | |
|
115 |
| -note: same as this |
116 |
| - --> $DIR/match_same_arms.rs:49:54 |
| 98 | + = help: or try changing either arm body |
| 99 | +note: other arm here |
| 100 | + --> $DIR/match_same_arms.rs:33:9 |
117 | 101 | |
|
118 |
| -LL | CommandInfo::BuiltIn { name, .. } => name.to_string(), |
119 |
| - | ^^^^^^^^^^^^^^^^ |
120 |
| -help: consider refactoring into `CommandInfo::BuiltIn { name, .. } | CommandInfo::External { name, .. }` |
| 102 | +LL | 3 => 2, //~ ERROR 3rd matched arms have same body |
| 103 | + | ^^^^^^ |
| 104 | + |
| 105 | +error: this match arm has an identical body to another arm |
| 106 | + --> $DIR/match_same_arms.rs:50:17 |
| 107 | + | |
| 108 | +LL | CommandInfo::External { name, .. } => name.to_string(), |
| 109 | + | ----------------------------------^^^^^^^^^^^^^^^^^^^^ |
| 110 | + | | |
| 111 | + | help: try merging the arm patterns: `CommandInfo::External { name, .. } | CommandInfo::BuiltIn { name, .. }` |
| 112 | + | |
| 113 | + = help: or try changing either arm body |
| 114 | +note: other arm here |
121 | 115 | --> $DIR/match_same_arms.rs:49:17
|
122 | 116 | |
|
123 | 117 | LL | CommandInfo::BuiltIn { name, .. } => name.to_string(),
|
124 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
125 |
| - = help: ...or consider changing the match arm bodies |
| 118 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
126 | 119 |
|
127 |
| -error: aborting due to 7 previous errors |
| 120 | +error: aborting due to 8 previous errors |
128 | 121 |
|
0 commit comments