rust/tests/ui/redundant_pattern_matching_option.stderr

201 lines
7.0 KiB
Plaintext
Raw Normal View History

error: redundant pattern matching, consider using `is_none()`
2021-10-04 01:33:40 -05:00
--> $DIR/redundant_pattern_matching_option.rs:14:12
|
LL | if let None = None::<()> {}
| -------^^^^------------- help: try this: `if None::<()>.is_none()`
|
= note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
error: redundant pattern matching, consider using `is_some()`
2021-10-04 01:33:40 -05:00
--> $DIR/redundant_pattern_matching_option.rs:16:12
|
LL | if let Some(_) = Some(42) {}
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
error: redundant pattern matching, consider using `is_some()`
2021-10-04 01:33:40 -05:00
--> $DIR/redundant_pattern_matching_option.rs:18:12
|
LL | if let Some(_) = Some(42) {
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
error: redundant pattern matching, consider using `is_some()`
2021-10-04 01:33:40 -05:00
--> $DIR/redundant_pattern_matching_option.rs:24:15
|
LL | while let Some(_) = Some(42) {}
| ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
error: redundant pattern matching, consider using `is_none()`
2021-10-04 01:33:40 -05:00
--> $DIR/redundant_pattern_matching_option.rs:26:15
|
LL | while let None = Some(42) {}
| ----------^^^^----------- help: try this: `while Some(42).is_none()`
error: redundant pattern matching, consider using `is_none()`
2021-10-04 01:33:40 -05:00
--> $DIR/redundant_pattern_matching_option.rs:28:15
|
LL | while let None = None::<()> {}
| ----------^^^^------------- help: try this: `while None::<()>.is_none()`
error: redundant pattern matching, consider using `is_some()`
2021-10-04 01:33:40 -05:00
--> $DIR/redundant_pattern_matching_option.rs:31:15
|
LL | while let Some(_) = v.pop() {
| ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
error: redundant pattern matching, consider using `is_some()`
2021-10-04 01:33:40 -05:00
--> $DIR/redundant_pattern_matching_option.rs:39:5
|
LL | / match Some(42) {
LL | | Some(_) => true,
LL | | None => false,
LL | | };
| |_____^ help: try this: `Some(42).is_some()`
error: redundant pattern matching, consider using `is_none()`
2021-10-04 01:33:40 -05:00
--> $DIR/redundant_pattern_matching_option.rs:44:5
|
LL | / match None::<()> {
LL | | Some(_) => false,
LL | | None => true,
LL | | };
| |_____^ help: try this: `None::<()>.is_none()`
error: redundant pattern matching, consider using `is_none()`
2021-10-04 01:33:40 -05:00
--> $DIR/redundant_pattern_matching_option.rs:49:13
|
LL | let _ = match None::<()> {
| _____________^
LL | | Some(_) => false,
LL | | None => true,
LL | | };
| |_____^ help: try this: `None::<()>.is_none()`
error: redundant pattern matching, consider using `is_some()`
2021-10-04 01:33:40 -05:00
--> $DIR/redundant_pattern_matching_option.rs:55: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()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:61:20
|
LL | let _ = if let Some(_) = gen_opt() {
| -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
error: redundant pattern matching, consider using `is_none()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:63:19
|
LL | } else if let None = gen_opt() {
| -------^^^^------------ help: try this: `if gen_opt().is_none()`
error: redundant pattern matching, consider using `is_some()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:69:12
|
LL | if let Some(..) = gen_opt() {}
| -------^^^^^^^^------------ help: try this: `if gen_opt().is_some()`
error: redundant pattern matching, consider using `is_some()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:84:12
|
LL | if let Some(_) = Some(42) {}
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
error: redundant pattern matching, consider using `is_none()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:86:12
|
LL | if let None = None::<()> {}
| -------^^^^------------- help: try this: `if None::<()>.is_none()`
error: redundant pattern matching, consider using `is_some()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:88:15
|
LL | while let Some(_) = Some(42) {}
| ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
error: redundant pattern matching, consider using `is_none()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:90:15
|
LL | while let None = None::<()> {}
| ----------^^^^------------- help: try this: `while None::<()>.is_none()`
error: redundant pattern matching, consider using `is_some()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:92:5
|
LL | / match Some(42) {
LL | | Some(_) => true,
LL | | None => false,
LL | | };
| |_____^ help: try this: `Some(42).is_some()`
error: redundant pattern matching, consider using `is_none()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:97:5
|
LL | / match None::<()> {
LL | | Some(_) => false,
LL | | None => true,
LL | | };
| |_____^ help: try this: `None::<()>.is_none()`
error: redundant pattern matching, consider using `is_none()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:105:12
|
LL | if let None = *(&None::<()>) {}
| -------^^^^----------------- help: try this: `if (&None::<()>).is_none()`
error: redundant pattern matching, consider using `is_none()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:106:12
|
LL | if let None = *&None::<()> {}
| -------^^^^--------------- help: try this: `if (&None::<()>).is_none()`
2023-05-05 14:33:16 -05:00
error: redundant pattern matching, consider using `is_some()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:112:5
2023-05-05 14:33:16 -05:00
|
2023-05-11 00:20:02 -05:00
LL | / match x {
2023-05-05 14:33:16 -05:00
LL | | Some(_) => true,
LL | | _ => false,
LL | | };
2023-05-11 00:20:02 -05:00
| |_____^ help: try this: `x.is_some()`
2023-05-05 14:33:16 -05:00
error: redundant pattern matching, consider using `is_none()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:117:5
2023-05-05 14:33:16 -05:00
|
2023-05-11 00:20:02 -05:00
LL | / match x {
2023-05-05 14:33:16 -05:00
LL | | None => true,
LL | | _ => false,
LL | | };
2023-05-11 00:20:02 -05:00
| |_____^ help: try this: `x.is_none()`
2023-05-05 14:33:16 -05:00
2023-05-15 12:43:22 -05:00
error: redundant pattern matching, consider using `is_none()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:122:5
2023-05-05 14:33:16 -05:00
|
2023-05-15 12:43:22 -05:00
LL | / match x {
LL | | Some(_) => false,
LL | | _ => true,
2023-05-05 14:33:16 -05:00
LL | | };
2023-05-15 12:43:22 -05:00
| |_____^ help: try this: `x.is_none()`
2023-05-05 14:33:16 -05:00
2023-05-15 12:43:22 -05:00
error: redundant pattern matching, consider using `is_some()`
2023-05-25 23:16:39 -05:00
--> $DIR/redundant_pattern_matching_option.rs:127:5
2023-05-05 14:33:16 -05:00
|
2023-05-15 12:43:22 -05:00
LL | / match x {
LL | | None => false,
LL | | _ => true,
2023-05-05 14:33:16 -05:00
LL | | };
2023-05-15 12:43:22 -05:00
| |_____^ help: try this: `x.is_some()`
2023-05-05 14:33:16 -05:00
2023-05-25 23:16:39 -05:00
error: redundant pattern matching, consider using `is_some()`
--> $DIR/redundant_pattern_matching_option.rs:142: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:144:13
|
LL | let _ = matches!(x, None);
| ^^^^^^^^^^^^^^^^^ help: try this: `x.is_none()`
error: aborting due to 28 previous errors