]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/tests/ui/bind_instead_of_map.stderr
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / tests / ui / bind_instead_of_map.stderr
diff --git a/src/tools/clippy/tests/ui/bind_instead_of_map.stderr b/src/tools/clippy/tests/ui/bind_instead_of_map.stderr
new file mode 100644 (file)
index 0000000..24c6b7f
--- /dev/null
@@ -0,0 +1,26 @@
+error: using `Option.and_then(Some)`, which is a no-op
+  --> $DIR/bind_instead_of_map.rs:8:13
+   |
+LL |     let _ = x.and_then(Some);
+   |             ^^^^^^^^^^^^^^^^ help: use the expression directly: `x`
+   |
+note: the lint level is defined here
+  --> $DIR/bind_instead_of_map.rs:2:9
+   |
+LL | #![deny(clippy::bind_instead_of_map)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
+  --> $DIR/bind_instead_of_map.rs:9:13
+   |
+LL |     let _ = x.and_then(|o| Some(o + 1));
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `x.map(|o| o + 1)`
+
+error: using `Result.and_then(Ok)`, which is a no-op
+  --> $DIR/bind_instead_of_map.rs:15:13
+   |
+LL |     let _ = x.and_then(Ok);
+   |             ^^^^^^^^^^^^^^ help: use the expression directly: `x`
+
+error: aborting due to 3 previous errors
+