summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/match_same_arms2.stderr
blob: 26c65f32ad780a454d133432a2d2f02c00dc6465 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
error: this `match` has identical arm bodies
  --> $DIR/match_same_arms2.rs:20:14
   |
LL |           _ => {
   |  ______________^
LL | |             //~ ERROR match arms have same body
LL | |             foo();
LL | |             let mut a = 42 + [23].len() as i32;
...  |
LL | |             a
LL | |         },
   | |_________^
   |
   = note: `-D clippy::match-same-arms` implied by `-D warnings`
note: same as this
  --> $DIR/match_same_arms2.rs:11:15
   |
LL |           42 => {
   |  _______________^
LL | |             foo();
LL | |             let mut a = 42 + [23].len() as i32;
LL | |             if true {
...  |
LL | |             a
LL | |         },
   | |_________^
note: `42` has the same arm body as the `_` wildcard, consider removing it
  --> $DIR/match_same_arms2.rs:11:15
   |
LL |           42 => {
   |  _______________^
LL | |             foo();
LL | |             let mut a = 42 + [23].len() as i32;
LL | |             if true {
...  |
LL | |             a
LL | |         },
   | |_________^

error: this `match` has identical arm bodies
  --> $DIR/match_same_arms2.rs:34:15
   |
LL |         51 => foo(), //~ ERROR match arms have same body
   |               ^^^^^
   |
note: same as this
  --> $DIR/match_same_arms2.rs:33:15
   |
LL |         42 => foo(),
   |               ^^^^^
help: consider refactoring into `42 | 51`
  --> $DIR/match_same_arms2.rs:33:9
   |
LL |         42 => foo(),
   |         ^^

error: this `match` has identical arm bodies
  --> $DIR/match_same_arms2.rs:40:17
   |
LL |         None => 24, //~ ERROR match arms have same body
   |                 ^^
   |
note: same as this
  --> $DIR/match_same_arms2.rs:39:20
   |
LL |         Some(_) => 24,
   |                    ^^
help: consider refactoring into `Some(_) | None`
  --> $DIR/match_same_arms2.rs:39:9
   |
LL |         Some(_) => 24,
   |         ^^^^^^^

error: this `match` has identical arm bodies
  --> $DIR/match_same_arms2.rs:62:28
   |
LL |         (None, Some(a)) => bar(a), //~ ERROR match arms have same body
   |                            ^^^^^^
   |
note: same as this
  --> $DIR/match_same_arms2.rs:61:28
   |
LL |         (Some(a), None) => bar(a),
   |                            ^^^^^^
help: consider refactoring into `(Some(a), None) | (None, Some(a))`
  --> $DIR/match_same_arms2.rs:61:9
   |
LL |         (Some(a), None) => bar(a),
   |         ^^^^^^^^^^^^^^^

error: this `match` has identical arm bodies
  --> $DIR/match_same_arms2.rs:68:26
   |
LL |         (.., Some(a)) => bar(a), //~ ERROR match arms have same body
   |                          ^^^^^^
   |
note: same as this
  --> $DIR/match_same_arms2.rs:67:26
   |
LL |         (Some(a), ..) => bar(a),
   |                          ^^^^^^
help: consider refactoring into `(Some(a), ..) | (.., Some(a))`
  --> $DIR/match_same_arms2.rs:67:9
   |
LL |         (Some(a), ..) => bar(a),
   |         ^^^^^^^^^^^^^

error: this `match` has identical arm bodies
  --> $DIR/match_same_arms2.rs:102:29
   |
LL |         (Ok(_), Some(x)) => println!("ok {}", x),
   |                             ^^^^^^^^^^^^^^^^^^^^
   |
note: same as this
  --> $DIR/match_same_arms2.rs:101:29
   |
LL |         (Ok(x), Some(_)) => println!("ok {}", x),
   |                             ^^^^^^^^^^^^^^^^^^^^
help: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
  --> $DIR/match_same_arms2.rs:101:9
   |
LL |         (Ok(x), Some(_)) => println!("ok {}", x),
   |         ^^^^^^^^^^^^^^^^
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: this `match` has identical arm bodies
  --> $DIR/match_same_arms2.rs:117:18
   |
LL |         Ok(_) => println!("ok"),
   |                  ^^^^^^^^^^^^^^
   |
note: same as this
  --> $DIR/match_same_arms2.rs:116:18
   |
LL |         Ok(3) => println!("ok"),
   |                  ^^^^^^^^^^^^^^
help: consider refactoring into `Ok(3) | Ok(_)`
  --> $DIR/match_same_arms2.rs:116:9
   |
LL |         Ok(3) => println!("ok"),
   |         ^^^^^
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 7 previous errors