]> git.lizzy.rs Git - rust.git/blob - tests/ui/match_same_arms.stderr
Merge remote-tracking branch 'origin/rust-1.34.1' into HEAD
[rust.git] / tests / ui / match_same_arms.stderr
1 error: this `match` has identical arm bodies
2   --> $DIR/match_same_arms.rs:37:14
3    |
4 LL |           _ => {
5    |  ______________^
6 LL | |             //~ ERROR match arms have same body
7 LL | |             foo();
8 LL | |             let mut a = 42 + [23].len() as i32;
9 ...  |
10 LL | |             a
11 LL | |         },
12    | |_________^
13    |
14    = note: `-D clippy::match-same-arms` implied by `-D warnings`
15 note: same as this
16   --> $DIR/match_same_arms.rs:28:15
17    |
18 LL |           42 => {
19    |  _______________^
20 LL | |             foo();
21 LL | |             let mut a = 42 + [23].len() as i32;
22 LL | |             if true {
23 ...  |
24 LL | |             a
25 LL | |         },
26    | |_________^
27 note: `42` has the same arm body as the `_` wildcard, consider removing it`
28   --> $DIR/match_same_arms.rs:28:15
29    |
30 LL |           42 => {
31    |  _______________^
32 LL | |             foo();
33 LL | |             let mut a = 42 + [23].len() as i32;
34 LL | |             if true {
35 ...  |
36 LL | |             a
37 LL | |         },
38    | |_________^
39
40 error: this `match` has identical arm bodies
41   --> $DIR/match_same_arms.rs:52:14
42    |
43 LL |         _ => 0, //~ ERROR match arms have same body
44    |              ^
45    |
46 note: same as this
47   --> $DIR/match_same_arms.rs:50:19
48    |
49 LL |         Abc::A => 0,
50    |                   ^
51 note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
52   --> $DIR/match_same_arms.rs:50:19
53    |
54 LL |         Abc::A => 0,
55    |                   ^
56
57 error: this `match` has identical arm bodies
58   --> $DIR/match_same_arms.rs:57:15
59    |
60 LL |         51 => foo(), //~ ERROR match arms have same body
61    |               ^^^^^
62    |
63 note: same as this
64   --> $DIR/match_same_arms.rs:56:15
65    |
66 LL |         42 => foo(),
67    |               ^^^^^
68 note: consider refactoring into `42 | 51`
69   --> $DIR/match_same_arms.rs:56:15
70    |
71 LL |         42 => foo(),
72    |               ^^^^^
73
74 error: this `match` has identical arm bodies
75   --> $DIR/match_same_arms.rs:63:17
76    |
77 LL |         None => 24, //~ ERROR match arms have same body
78    |                 ^^
79    |
80 note: same as this
81   --> $DIR/match_same_arms.rs:62:20
82    |
83 LL |         Some(_) => 24,
84    |                    ^^
85 note: consider refactoring into `Some(_) | None`
86   --> $DIR/match_same_arms.rs:62:20
87    |
88 LL |         Some(_) => 24,
89    |                    ^^
90
91 error: this `match` has identical arm bodies
92   --> $DIR/match_same_arms.rs:85:28
93    |
94 LL |         (None, Some(a)) => bar(a), //~ ERROR match arms have same body
95    |                            ^^^^^^
96    |
97 note: same as this
98   --> $DIR/match_same_arms.rs:84:28
99    |
100 LL |         (Some(a), None) => bar(a),
101    |                            ^^^^^^
102 note: consider refactoring into `(Some(a), None) | (None, Some(a))`
103   --> $DIR/match_same_arms.rs:84:28
104    |
105 LL |         (Some(a), None) => bar(a),
106    |                            ^^^^^^
107
108 error: this `match` has identical arm bodies
109   --> $DIR/match_same_arms.rs:91:26
110    |
111 LL |         (.., Some(a)) => bar(a), //~ ERROR match arms have same body
112    |                          ^^^^^^
113    |
114 note: same as this
115   --> $DIR/match_same_arms.rs:90:26
116    |
117 LL |         (Some(a), ..) => bar(a),
118    |                          ^^^^^^
119 note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
120   --> $DIR/match_same_arms.rs:90:26
121    |
122 LL |         (Some(a), ..) => bar(a),
123    |                          ^^^^^^
124
125 error: this `match` has identical arm bodies
126   --> $DIR/match_same_arms.rs:97:20
127    |
128 LL |         (.., 3) => 42, //~ ERROR match arms have same body
129    |                    ^^
130    |
131 note: same as this
132   --> $DIR/match_same_arms.rs:96:23
133    |
134 LL |         (1, .., 3) => 42,
135    |                       ^^
136 note: consider refactoring into `(1, .., 3) | (.., 3)`
137   --> $DIR/match_same_arms.rs:96:23
138    |
139 LL |         (1, .., 3) => 42,
140    |                       ^^
141
142 error: aborting due to 7 previous errors
143