summaryrefslogtreecommitdiff
path: root/src/tools/clippy/tests/ui/redundant_pattern_matching_option.stderr
blob: 7c5a047e455cf4f7a919bb9b6285d3fdac96e7f6 (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
146
147
148
149
150
151
152
error: redundant pattern matching, consider using `is_none()`
  --> $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()`
  --> $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()`
  --> $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()`
  --> $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()`
  --> $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()`
  --> $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()`
  --> $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()`
  --> $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()`
  --> $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()`
  --> $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()`
  --> $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()`
  --> $DIR/redundant_pattern_matching_option.rs:59: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:61: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:67: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:82: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:84: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:86: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:88: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:90: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()`
  --> $DIR/redundant_pattern_matching_option.rs:95: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()`
  --> $DIR/redundant_pattern_matching_option.rs:103: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:104:12
   |
LL |     if let None = *&None::<()> {}
   |     -------^^^^--------------- help: try this: `if (&None::<()>).is_none()`

error: aborting due to 22 previous errors