summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/redundant_pattern_matching_option.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/redundant_pattern_matching_option.stderr')
-rw-r--r--src/tools/clippy/tests/ui/redundant_pattern_matching_option.stderr66
1 files changed, 39 insertions, 27 deletions
diff --git a/src/tools/clippy/tests/ui/redundant_pattern_matching_option.stderr b/src/tools/clippy/tests/ui/redundant_pattern_matching_option.stderr
index a69eb3905..717b603c4 100644
--- a/src/tools/clippy/tests/ui/redundant_pattern_matching_option.stderr
+++ b/src/tools/clippy/tests/ui/redundant_pattern_matching_option.stderr
@@ -1,5 +1,5 @@
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:14:12
+ --> $DIR/redundant_pattern_matching_option.rs:15:12
|
LL | if let None = None::<()> {}
| -------^^^^------------- help: try this: `if None::<()>.is_none()`
@@ -7,43 +7,43 @@ LL | if let None = None::<()> {}
= note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:16:12
+ --> $DIR/redundant_pattern_matching_option.rs:17:12
|
LL | if let Some(_) = Some(42) {}
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:18:12
+ --> $DIR/redundant_pattern_matching_option.rs:19:12
|
LL | if let Some(_) = Some(42) {
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:24:15
+ --> $DIR/redundant_pattern_matching_option.rs:25:15
|
LL | while let Some(_) = Some(42) {}
| ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:26:15
+ --> $DIR/redundant_pattern_matching_option.rs:27:15
|
LL | while let None = Some(42) {}
| ----------^^^^----------- help: try this: `while Some(42).is_none()`
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:28:15
+ --> $DIR/redundant_pattern_matching_option.rs:29:15
|
LL | while let None = None::<()> {}
| ----------^^^^------------- help: try this: `while None::<()>.is_none()`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:31:15
+ --> $DIR/redundant_pattern_matching_option.rs:32:15
|
LL | while let Some(_) = v.pop() {
| ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:39:5
+ --> $DIR/redundant_pattern_matching_option.rs:40:5
|
LL | / match Some(42) {
LL | | Some(_) => true,
@@ -52,7 +52,7 @@ LL | | };
| |_____^ help: try this: `Some(42).is_some()`
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:44:5
+ --> $DIR/redundant_pattern_matching_option.rs:45:5
|
LL | / match None::<()> {
LL | | Some(_) => false,
@@ -61,7 +61,7 @@ LL | | };
| |_____^ help: try this: `None::<()>.is_none()`
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:49:13
+ --> $DIR/redundant_pattern_matching_option.rs:50:13
|
LL | let _ = match None::<()> {
| _____________^
@@ -71,55 +71,55 @@ LL | | };
| |_____^ help: try this: `None::<()>.is_none()`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:55:20
+ --> $DIR/redundant_pattern_matching_option.rs:56:20
|
LL | let _ = if let Some(_) = opt { true } else { false };
| -------^^^^^^^------ help: try this: `if opt.is_some()`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:60:20
+ --> $DIR/redundant_pattern_matching_option.rs:62:20
|
LL | let _ = if let Some(_) = gen_opt() {
| -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:62:19
+ --> $DIR/redundant_pattern_matching_option.rs:64:19
|
LL | } else if let None = gen_opt() {
| -------^^^^------------ help: try this: `if gen_opt().is_none()`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:68:12
+ --> $DIR/redundant_pattern_matching_option.rs:70:12
|
LL | if let Some(..) = gen_opt() {}
| -------^^^^^^^^------------ help: try this: `if gen_opt().is_some()`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:83:12
+ --> $DIR/redundant_pattern_matching_option.rs:85:12
|
LL | if let Some(_) = Some(42) {}
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:85:12
+ --> $DIR/redundant_pattern_matching_option.rs:87:12
|
LL | if let None = None::<()> {}
| -------^^^^------------- help: try this: `if None::<()>.is_none()`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:87:15
+ --> $DIR/redundant_pattern_matching_option.rs:89:15
|
LL | while let Some(_) = Some(42) {}
| ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:89:15
+ --> $DIR/redundant_pattern_matching_option.rs:91:15
|
LL | while let None = None::<()> {}
| ----------^^^^------------- help: try this: `while None::<()>.is_none()`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:91:5
+ --> $DIR/redundant_pattern_matching_option.rs:93:5
|
LL | / match Some(42) {
LL | | Some(_) => true,
@@ -128,7 +128,7 @@ LL | | };
| |_____^ help: try this: `Some(42).is_some()`
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:96:5
+ --> $DIR/redundant_pattern_matching_option.rs:98:5
|
LL | / match None::<()> {
LL | | Some(_) => false,
@@ -137,19 +137,19 @@ LL | | };
| |_____^ help: try this: `None::<()>.is_none()`
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:104:12
+ --> $DIR/redundant_pattern_matching_option.rs:106:12
|
LL | if let None = *(&None::<()>) {}
| -------^^^^----------------- help: try this: `if (&None::<()>).is_none()`
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:105:12
+ --> $DIR/redundant_pattern_matching_option.rs:107:12
|
LL | if let None = *&None::<()> {}
| -------^^^^--------------- help: try this: `if (&None::<()>).is_none()`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:111:5
+ --> $DIR/redundant_pattern_matching_option.rs:113:5
|
LL | / match x {
LL | | Some(_) => true,
@@ -158,7 +158,7 @@ LL | | };
| |_____^ help: try this: `x.is_some()`
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:116:5
+ --> $DIR/redundant_pattern_matching_option.rs:118:5
|
LL | / match x {
LL | | None => true,
@@ -167,7 +167,7 @@ LL | | };
| |_____^ help: try this: `x.is_none()`
error: redundant pattern matching, consider using `is_none()`
- --> $DIR/redundant_pattern_matching_option.rs:121:5
+ --> $DIR/redundant_pattern_matching_option.rs:123:5
|
LL | / match x {
LL | | Some(_) => false,
@@ -176,7 +176,7 @@ LL | | };
| |_____^ help: try this: `x.is_none()`
error: redundant pattern matching, consider using `is_some()`
- --> $DIR/redundant_pattern_matching_option.rs:126:5
+ --> $DIR/redundant_pattern_matching_option.rs:128:5
|
LL | / match x {
LL | | None => false,
@@ -184,5 +184,17 @@ LL | | _ => true,
LL | | };
| |_____^ help: try this: `x.is_some()`
-error: aborting due to 26 previous errors
+error: redundant pattern matching, consider using `is_some()`
+ --> $DIR/redundant_pattern_matching_option.rs:143:13
+ |
+LL | let _ = matches!(x, Some(_));
+ | ^^^^^^^^^^^^^^^^^^^^ help: try this: `x.is_some()`
+
+error: redundant pattern matching, consider using `is_none()`
+ --> $DIR/redundant_pattern_matching_option.rs:145:13
+ |
+LL | let _ = matches!(x, None);
+ | ^^^^^^^^^^^^^^^^^ help: try this: `x.is_none()`
+
+error: aborting due to 28 previous errors