about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSamuel E. Moelius III <sam@moeli.us>2020-11-09 07:49:14 -0500
committerSamuel E. Moelius III <sam@moeli.us>2020-11-09 07:49:14 -0500
commit4852cca61bb989adf77b1d202eae6b40067fa9ab (patch)
tree7b1eccda783a01a4bad57fe17f9b5f748e63395c
parent06e81bb49370a0154c3fa7de0bbc8b31c7bbe37b (diff)
downloadrust-4852cca61bb989adf77b1d202eae6b40067fa9ab.tar.gz
rust-4852cca61bb989adf77b1d202eae6b40067fa9ab.zip
Allow `let_underscore_drop` in `filter_methods` test
-rw-r--r--tests/ui/filter_methods.rs1
-rw-r--r--tests/ui/filter_methods.stderr55
2 files changed, 6 insertions, 50 deletions
diff --git a/tests/ui/filter_methods.rs b/tests/ui/filter_methods.rs
index ef434245fd7..51450241619 100644
--- a/tests/ui/filter_methods.rs
+++ b/tests/ui/filter_methods.rs
@@ -1,4 +1,5 @@
 #![warn(clippy::all, clippy::pedantic)]
+#![allow(clippy::clippy::let_underscore_drop)]
 #![allow(clippy::missing_docs_in_private_items)]
 
 fn main() {
diff --git a/tests/ui/filter_methods.stderr b/tests/ui/filter_methods.stderr
index b5ac90282dc..11922681379 100644
--- a/tests/ui/filter_methods.stderr
+++ b/tests/ui/filter_methods.stderr
@@ -1,14 +1,5 @@
-error: non-binding `let` on a type that implements `Drop`
-  --> $DIR/filter_methods.rs:5:5
-   |
-LL |     let _: Vec<_> = vec![5; 6].into_iter().filter(|&x| x == 0).map(|x| x * 2).collect();
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: `-D clippy::let-underscore-drop` implied by `-D warnings`
-   = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
-
 error: called `filter(..).map(..)` on an `Iterator`
-  --> $DIR/filter_methods.rs:5:21
+  --> $DIR/filter_methods.rs:6:21
    |
 LL |     let _: Vec<_> = vec![5; 6].into_iter().filter(|&x| x == 0).map(|x| x * 2).collect();
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -16,20 +7,8 @@ LL |     let _: Vec<_> = vec![5; 6].into_iter().filter(|&x| x == 0).map(|x| x *
    = note: `-D clippy::filter-map` implied by `-D warnings`
    = help: this is more succinctly expressed by calling `.filter_map(..)` instead
 
-error: non-binding `let` on a type that implements `Drop`
-  --> $DIR/filter_methods.rs:7:5
-   |
-LL | /     let _: Vec<_> = vec![5_i8; 6]
-LL | |         .into_iter()
-LL | |         .filter(|&x| x == 0)
-LL | |         .flat_map(|x| x.checked_mul(2))
-LL | |         .collect();
-   | |___________________^
-   |
-   = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
-
 error: called `filter(..).flat_map(..)` on an `Iterator`
-  --> $DIR/filter_methods.rs:7:21
+  --> $DIR/filter_methods.rs:8:21
    |
 LL |       let _: Vec<_> = vec![5_i8; 6]
    |  _____________________^
@@ -40,20 +19,8 @@ LL | |         .flat_map(|x| x.checked_mul(2))
    |
    = help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
 
-error: non-binding `let` on a type that implements `Drop`
-  --> $DIR/filter_methods.rs:13:5
-   |
-LL | /     let _: Vec<_> = vec![5_i8; 6]
-LL | |         .into_iter()
-LL | |         .filter_map(|x| x.checked_mul(2))
-LL | |         .flat_map(|x| x.checked_mul(2))
-LL | |         .collect();
-   | |___________________^
-   |
-   = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
-
 error: called `filter_map(..).flat_map(..)` on an `Iterator`
-  --> $DIR/filter_methods.rs:13:21
+  --> $DIR/filter_methods.rs:14:21
    |
 LL |       let _: Vec<_> = vec![5_i8; 6]
    |  _____________________^
@@ -64,20 +31,8 @@ LL | |         .flat_map(|x| x.checked_mul(2))
    |
    = help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
 
-error: non-binding `let` on a type that implements `Drop`
-  --> $DIR/filter_methods.rs:19:5
-   |
-LL | /     let _: Vec<_> = vec![5_i8; 6]
-LL | |         .into_iter()
-LL | |         .filter_map(|x| x.checked_mul(2))
-LL | |         .map(|x| x.checked_mul(2))
-LL | |         .collect();
-   | |___________________^
-   |
-   = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
-
 error: called `filter_map(..).map(..)` on an `Iterator`
-  --> $DIR/filter_methods.rs:19:21
+  --> $DIR/filter_methods.rs:20:21
    |
 LL |       let _: Vec<_> = vec![5_i8; 6]
    |  _____________________^
@@ -88,5 +43,5 @@ LL | |         .map(|x| x.checked_mul(2))
    |
    = help: this is more succinctly expressed by only calling `.filter_map(..)` instead
 
-error: aborting due to 8 previous errors
+error: aborting due to 4 previous errors