]> git.lizzy.rs Git - rust.git/blob - tests/ui/redundant_pattern_matching.stderr
Merge branch 'master' into rustfmt_tests
[rust.git] / tests / ui / redundant_pattern_matching.stderr
1 error: redundant pattern matching, consider using `is_ok()`
2   --> $DIR/redundant_pattern_matching.rs:14:12
3    |
4 14 |     if let Ok(_) = Ok::<i32, i32>(42) {}
5    |     -------^^^^^------------------------ help: try this: `if Ok::<i32, i32>(42).is_ok()`
6    |
7    = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
8
9 error: redundant pattern matching, consider using `is_err()`
10   --> $DIR/redundant_pattern_matching.rs:16:12
11    |
12 16 |     if let Err(_) = Err::<i32, i32>(42) {}
13    |     -------^^^^^^------------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
14
15 error: redundant pattern matching, consider using `is_none()`
16   --> $DIR/redundant_pattern_matching.rs:18:12
17    |
18 18 |     if let None = None::<()> {}
19    |     -------^^^^---------------- help: try this: `if None::<()>.is_none()`
20
21 error: redundant pattern matching, consider using `is_some()`
22   --> $DIR/redundant_pattern_matching.rs:20:12
23    |
24 20 |     if let Some(_) = Some(42) {}
25    |     -------^^^^^^^-------------- help: try this: `if Some(42).is_some()`
26
27 error: redundant pattern matching, consider using `is_ok()`
28   --> $DIR/redundant_pattern_matching.rs:34:5
29    |
30 34 | /     match Ok::<i32, i32>(42) {
31 35 | |         Ok(_) => true,
32 36 | |         Err(_) => false,
33 37 | |     };
34    | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
35
36 error: redundant pattern matching, consider using `is_err()`
37   --> $DIR/redundant_pattern_matching.rs:39:5
38    |
39 39 | /     match Ok::<i32, i32>(42) {
40 40 | |         Ok(_) => false,
41 41 | |         Err(_) => true,
42 42 | |     };
43    | |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
44
45 error: redundant pattern matching, consider using `is_err()`
46   --> $DIR/redundant_pattern_matching.rs:44:5
47    |
48 44 | /     match Err::<i32, i32>(42) {
49 45 | |         Ok(_) => false,
50 46 | |         Err(_) => true,
51 47 | |     };
52    | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
53
54 error: redundant pattern matching, consider using `is_ok()`
55   --> $DIR/redundant_pattern_matching.rs:49:5
56    |
57 49 | /     match Err::<i32, i32>(42) {
58 50 | |         Ok(_) => true,
59 51 | |         Err(_) => false,
60 52 | |     };
61    | |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
62
63 error: redundant pattern matching, consider using `is_some()`
64   --> $DIR/redundant_pattern_matching.rs:54:5
65    |
66 54 | /     match Some(42) {
67 55 | |         Some(_) => true,
68 56 | |         None => false,
69 57 | |     };
70    | |_____^ help: try this: `Some(42).is_some()`
71
72 error: redundant pattern matching, consider using `is_none()`
73   --> $DIR/redundant_pattern_matching.rs:59:5
74    |
75 59 | /     match None::<()> {
76 60 | |         Some(_) => false,
77 61 | |         None => true,
78 62 | |     };
79    | |_____^ help: try this: `None::<()>.is_none()`
80
81 error: aborting due to 10 previous errors
82