summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/partialeq_to_none.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:03:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:03:36 +0000
commit17d40c6057c88f4c432b0d7bac88e1b84cb7e67f (patch)
tree3f66c4a5918660bb8a758ab6cda5ff8ee4f6cdcd /src/tools/clippy/tests/ui/partialeq_to_none.stderr
parentAdding upstream version 1.64.0+dfsg1. (diff)
downloadrustc-17d40c6057c88f4c432b0d7bac88e1b84cb7e67f.tar.xz
rustc-17d40c6057c88f4c432b0d7bac88e1b84cb7e67f.zip
Adding upstream version 1.65.0+dfsg1.upstream/1.65.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/partialeq_to_none.stderr')
-rw-r--r--src/tools/clippy/tests/ui/partialeq_to_none.stderr110
1 files changed, 110 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/partialeq_to_none.stderr b/src/tools/clippy/tests/ui/partialeq_to_none.stderr
new file mode 100644
index 000000000..d06ab7aee
--- /dev/null
+++ b/src/tools/clippy/tests/ui/partialeq_to_none.stderr
@@ -0,0 +1,110 @@
+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:44: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:45: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:46: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:47: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:49: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:51: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:53: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:55: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:57: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:67: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:68: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:69: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:70: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:73:13
+ |
+LL | let _ = None != *x;
+ | ^^^^^^^^^^ help: use `Option::is_some()` instead: `(*x).is_some()`
+
+error: aborting due to 15 previous errors
+