Skip to content

Commit e493dad

Browse files
committed
Adapt clippy test.
1 parent b790f46 commit e493dad

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

src/tools/clippy/tests/ui/infallible_destructuring_match.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@run-rustfix
2-
#![feature(exhaustive_patterns, never_type)]
2+
#![feature(never_type)]
33
#![allow(dead_code, unreachable_code, unused_variables)]
44
#![allow(clippy::let_and_return)]
55

src/tools/clippy/tests/ui/infallible_destructuring_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@run-rustfix
2-
#![feature(exhaustive_patterns, never_type)]
2+
#![feature(never_type)]
33
#![allow(dead_code, unreachable_code, unused_variables)]
44
#![allow(clippy::let_and_return)]
55

src/tools/clippy/tests/ui/single_match_else.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//@aux-build: proc_macros.rs
33
#![warn(clippy::single_match_else)]
44
#![allow(unused, clippy::needless_return, clippy::no_effect, clippy::uninlined_format_args)]
5+
#![allow(irrefutable_let_patterns)] // The fixed code may introduce some cases.
56
extern crate proc_macros;
67
use proc_macros::with_span;
78

src/tools/clippy/tests/ui/single_match_else.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//@aux-build: proc_macros.rs
33
#![warn(clippy::single_match_else)]
44
#![allow(unused, clippy::needless_return, clippy::no_effect, clippy::uninlined_format_args)]
5+
#![allow(irrefutable_let_patterns)] // The fixed code may introduce some cases.
56
extern crate proc_macros;
67
use proc_macros::with_span;
78

src/tools/clippy/tests/ui/single_match_else.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
2-
--> $DIR/single_match_else.rs:17:13
2+
--> $DIR/single_match_else.rs:18:13
33
|
44
LL | let _ = match ExprNode::Butterflies {
55
| _____________^
@@ -21,7 +21,7 @@ LL ~ };
2121
|
2222

2323
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
24-
--> $DIR/single_match_else.rs:82:5
24+
--> $DIR/single_match_else.rs:83:5
2525
|
2626
LL | / match Some(1) {
2727
LL | | Some(a) => println!("${:?}", a),
@@ -41,7 +41,7 @@ LL + }
4141
|
4242

4343
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
44-
--> $DIR/single_match_else.rs:91:5
44+
--> $DIR/single_match_else.rs:92:5
4545
|
4646
LL | / match Some(1) {
4747
LL | | Some(a) => println!("${:?}", a),
@@ -61,7 +61,7 @@ LL + }
6161
|
6262

6363
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
64-
--> $DIR/single_match_else.rs:101:5
64+
--> $DIR/single_match_else.rs:102:5
6565
|
6666
LL | / match Result::<i32, Infallible>::Ok(1) {
6767
LL | | Ok(a) => println!("${:?}", a),
@@ -81,7 +81,7 @@ LL + }
8181
|
8282

8383
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
84-
--> $DIR/single_match_else.rs:110:5
84+
--> $DIR/single_match_else.rs:111:5
8585
|
8686
LL | / match Cow::from("moo") {
8787
LL | | Cow::Owned(a) => println!("${:?}", a),
@@ -101,7 +101,7 @@ LL + }
101101
|
102102

103103
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
104-
--> $DIR/single_match_else.rs:120:5
104+
--> $DIR/single_match_else.rs:121:5
105105
|
106106
LL | / match bar {
107107
LL | | Some(v) => unsafe {
@@ -124,7 +124,7 @@ LL + }
124124
|
125125

126126
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
127-
--> $DIR/single_match_else.rs:131:5
127+
--> $DIR/single_match_else.rs:132:5
128128
|
129129
LL | / match bar {
130130
LL | | Some(v) => {
@@ -148,7 +148,7 @@ LL + } }
148148
|
149149

150150
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
151-
--> $DIR/single_match_else.rs:143:5
151+
--> $DIR/single_match_else.rs:144:5
152152
|
153153
LL | / match bar {
154154
LL | | Some(v) => unsafe {
@@ -172,7 +172,7 @@ LL + } }
172172
|
173173

174174
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
175-
--> $DIR/single_match_else.rs:155:5
175+
--> $DIR/single_match_else.rs:156:5
176176
|
177177
LL | / match bar {
178178
LL | | #[rustfmt::skip]

0 commit comments

Comments
 (0)