summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/partialeq_to_none.stderr
blob: 4f84862a22b8f092f8b87eeeaff9fa57beed3191 (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
error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:15:8
   |
LL |     if f != None { "yay" } else { "nay" }
   |        ^^^^^^^^^ help: use `Option::is_some()` instead: `f.is_some()`
   |
   = note: `-D clippy::partialeq-to-none` implied by `-D warnings`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:45:13
   |
LL |     let _ = x == None;
   |             ^^^^^^^^^ help: use `Option::is_none()` instead: `x.is_none()`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:46:13
   |
LL |     let _ = x != None;
   |             ^^^^^^^^^ help: use `Option::is_some()` instead: `x.is_some()`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:47:13
   |
LL |     let _ = None == x;
   |             ^^^^^^^^^ help: use `Option::is_none()` instead: `x.is_none()`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:48:13
   |
LL |     let _ = None != x;
   |             ^^^^^^^^^ help: use `Option::is_some()` instead: `x.is_some()`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:50:8
   |
LL |     if foobar() == None {}
   |        ^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `foobar().is_none()`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:52:8
   |
LL |     if bar().ok() != None {}
   |        ^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `bar().ok().is_some()`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:54:13
   |
LL |     let _ = Some(1 + 2) != None;
   |             ^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `Some(1 + 2).is_some()`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:56:13
   |
LL |     let _ = { Some(0) } == None;
   |             ^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `{ Some(0) }.is_none()`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:58:13
   |
LL |       let _ = {
   |  _____________^
LL | |         /*
LL | |           This comment runs long
LL | |         */
LL | |         Some(1)
LL | |     } != None;
   | |_____________^
   |
help: use `Option::is_some()` instead
   |
LL ~     let _ = {
LL +         /*
LL +           This comment runs long
LL +         */
LL +         Some(1)
LL ~     }.is_some();
   |

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:68:13
   |
LL |     let _ = optref() == &&None;
   |             ^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `optref().is_none()`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:69:13
   |
LL |     let _ = &&None != optref();
   |             ^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `optref().is_some()`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:70:13
   |
LL |     let _ = **optref() == None;
   |             ^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `optref().is_none()`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:71:13
   |
LL |     let _ = &None != *optref();
   |             ^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `optref().is_some()`

error: binary comparison to literal `Option::None`
  --> $DIR/partialeq_to_none.rs:74:13
   |
LL |     let _ = None != *x;
   |             ^^^^^^^^^^ help: use `Option::is_some()` instead: `(*x).is_some()`

error: aborting due to 15 previous errors