]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/partialeq_to_none.stderr
Auto merge of #101969 - reez12g:issue-101306, r=reez12g
[rust.git] / src / tools / clippy / tests / ui / partialeq_to_none.stderr
1 error: binary comparison to literal `Option::None`
2   --> $DIR/partialeq_to_none.rs:14:8
3    |
4 LL |     if f != None { "yay" } else { "nay" }
5    |        ^^^^^^^^^ help: use `Option::is_some()` instead: `f.is_some()`
6    |
7    = note: `-D clippy::partialeq-to-none` implied by `-D warnings`
8
9 error: binary comparison to literal `Option::None`
10   --> $DIR/partialeq_to_none.rs:44:13
11    |
12 LL |     let _ = x == None;
13    |             ^^^^^^^^^ help: use `Option::is_none()` instead: `x.is_none()`
14
15 error: binary comparison to literal `Option::None`
16   --> $DIR/partialeq_to_none.rs:45:13
17    |
18 LL |     let _ = x != None;
19    |             ^^^^^^^^^ help: use `Option::is_some()` instead: `x.is_some()`
20
21 error: binary comparison to literal `Option::None`
22   --> $DIR/partialeq_to_none.rs:46:13
23    |
24 LL |     let _ = None == x;
25    |             ^^^^^^^^^ help: use `Option::is_none()` instead: `x.is_none()`
26
27 error: binary comparison to literal `Option::None`
28   --> $DIR/partialeq_to_none.rs:47:13
29    |
30 LL |     let _ = None != x;
31    |             ^^^^^^^^^ help: use `Option::is_some()` instead: `x.is_some()`
32
33 error: binary comparison to literal `Option::None`
34   --> $DIR/partialeq_to_none.rs:49:8
35    |
36 LL |     if foobar() == None {}
37    |        ^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `foobar().is_none()`
38
39 error: binary comparison to literal `Option::None`
40   --> $DIR/partialeq_to_none.rs:51:8
41    |
42 LL |     if bar().ok() != None {}
43    |        ^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `bar().ok().is_some()`
44
45 error: binary comparison to literal `Option::None`
46   --> $DIR/partialeq_to_none.rs:53:13
47    |
48 LL |     let _ = Some(1 + 2) != None;
49    |             ^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `Some(1 + 2).is_some()`
50
51 error: binary comparison to literal `Option::None`
52   --> $DIR/partialeq_to_none.rs:55:13
53    |
54 LL |     let _ = { Some(0) } == None;
55    |             ^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `{ Some(0) }.is_none()`
56
57 error: binary comparison to literal `Option::None`
58   --> $DIR/partialeq_to_none.rs:57:13
59    |
60 LL |       let _ = {
61    |  _____________^
62 LL | |         /*
63 LL | |           This comment runs long
64 LL | |         */
65 LL | |         Some(1)
66 LL | |     } != None;
67    | |_____________^
68    |
69 help: use `Option::is_some()` instead
70    |
71 LL ~     let _ = {
72 LL +         /*
73 LL +           This comment runs long
74 LL +         */
75 LL +         Some(1)
76 LL ~     }.is_some();
77    |
78
79 error: binary comparison to literal `Option::None`
80   --> $DIR/partialeq_to_none.rs:67:13
81    |
82 LL |     let _ = optref() == &&None;
83    |             ^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `optref().is_none()`
84
85 error: binary comparison to literal `Option::None`
86   --> $DIR/partialeq_to_none.rs:68:13
87    |
88 LL |     let _ = &&None != optref();
89    |             ^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `optref().is_some()`
90
91 error: binary comparison to literal `Option::None`
92   --> $DIR/partialeq_to_none.rs:69:13
93    |
94 LL |     let _ = **optref() == None;
95    |             ^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `optref().is_none()`
96
97 error: binary comparison to literal `Option::None`
98   --> $DIR/partialeq_to_none.rs:70:13
99    |
100 LL |     let _ = &None != *optref();
101    |             ^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `optref().is_some()`
102
103 error: binary comparison to literal `Option::None`
104   --> $DIR/partialeq_to_none.rs:73:13
105    |
106 LL |     let _ = None != *x;
107    |             ^^^^^^^^^^ help: use `Option::is_some()` instead: `(*x).is_some()`
108
109 error: aborting due to 15 previous errors
110