summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/lines_filter_map_ok.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/lines_filter_map_ok.stderr')
-rw-r--r--src/tools/clippy/tests/ui/lines_filter_map_ok.stderr51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/lines_filter_map_ok.stderr b/src/tools/clippy/tests/ui/lines_filter_map_ok.stderr
new file mode 100644
index 000000000..cddd403d5
--- /dev/null
+++ b/src/tools/clippy/tests/ui/lines_filter_map_ok.stderr
@@ -0,0 +1,51 @@
+error: `filter_map()` will run forever if the iterator repeatedly produces an `Err`
+ --> $DIR/lines_filter_map_ok.rs:11:31
+ |
+LL | BufReader::new(f).lines().filter_map(Result::ok).for_each(|_| ());
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)`
+ |
+note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error
+ --> $DIR/lines_filter_map_ok.rs:11:5
+ |
+LL | BufReader::new(f).lines().filter_map(Result::ok).for_each(|_| ());
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: `-D clippy::lines-filter-map-ok` implied by `-D warnings`
+
+error: `flat_map()` will run forever if the iterator repeatedly produces an `Err`
+ --> $DIR/lines_filter_map_ok.rs:14:31
+ |
+LL | BufReader::new(f).lines().flat_map(Result::ok).for_each(|_| ());
+ | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)`
+ |
+note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error
+ --> $DIR/lines_filter_map_ok.rs:14:5
+ |
+LL | BufReader::new(f).lines().flat_map(Result::ok).for_each(|_| ());
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: `filter_map()` will run forever if the iterator repeatedly produces an `Err`
+ --> $DIR/lines_filter_map_ok.rs:17:25
+ |
+LL | io::stdin().lines().filter_map(Result::ok).for_each(|_| ());
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)`
+ |
+note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error
+ --> $DIR/lines_filter_map_ok.rs:17:5
+ |
+LL | io::stdin().lines().filter_map(Result::ok).for_each(|_| ());
+ | ^^^^^^^^^^^^^^^^^^^
+
+error: `filter_map()` will run forever if the iterator repeatedly produces an `Err`
+ --> $DIR/lines_filter_map_ok.rs:19:25
+ |
+LL | io::stdin().lines().filter_map(|x| x.ok()).for_each(|_| ());
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)`
+ |
+note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error
+ --> $DIR/lines_filter_map_ok.rs:19:5
+ |
+LL | io::stdin().lines().filter_map(|x| x.ok()).for_each(|_| ());
+ | ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 4 previous errors
+