mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
111 lines
3.5 KiB
Text
111 lines
3.5 KiB
Text
|
error: binary comparison to literal `Option::None`
|
||
|
--> $DIR/partialeq_to_none.rs:14: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:32: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:33: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:34: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:35: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:37: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:39: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:41: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:43: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:45: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:55: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:56: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:57: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:58: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:61:13
|
||
|
|
|
||
|
LL | let _ = None != *x;
|
||
|
| ^^^^^^^^^^ help: use `Option::is_some()` instead: `(*x).is_some()`
|
||
|
|
||
|
error: aborting due to 15 previous errors
|
||
|
|