diff --git a/tests/ui/borrow_box.stderr b/tests/ui/borrow_box.stderr index a40789cd4263..3eac32815be3 100644 --- a/tests/ui/borrow_box.stderr +++ b/tests/ui/borrow_box.stderr @@ -22,15 +22,6 @@ error: you seem to be trying to use `&Box`. Consider using just `&T` LL | fn test4(a: &Box); | ^^^^^^^^^^ help: try: `&bool` -error: non-binding let on a type that implements `Drop` - --> $DIR/borrow_box.rs:63:5 - | -LL | let _ = foo; - | ^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: you seem to be trying to use `&Box`. Consider using just `&T` --> $DIR/borrow_box.rs:95:25 | @@ -73,5 +64,5 @@ error: you seem to be trying to use `&Box`. Consider using just `&T` LL | pub fn test20(_display: &Box<(dyn Display + Send)>) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn Display + Send)` -error: aborting due to 11 previous errors +error: aborting due to 10 previous errors diff --git a/tests/ui/borrow_interior_mutable_const/others.stderr b/tests/ui/borrow_interior_mutable_const/others.stderr index 976c412c7a87..9a908cf30e94 100644 --- a/tests/ui/borrow_interior_mutable_const/others.stderr +++ b/tests/ui/borrow_interior_mutable_const/others.stderr @@ -47,15 +47,6 @@ LL | let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability | = help: assign this const to a local or static variable, and use the variable here -error: non-binding let on a type that implements `Drop` - --> $DIR/others.rs:72:5 - | -LL | let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: a `const` item with interior mutability should not be borrowed --> $DIR/others.rs:72:14 | @@ -104,22 +95,6 @@ LL | let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability | = help: assign this const to a local or static variable, and use the variable here -error: non-binding let on a type that implements `Drop` - --> $DIR/others.rs:83:5 - | -LL | let _ = ATOMIC_TUPLE.1.into_iter(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: non-binding let on a type that implements `Drop` - --> $DIR/others.rs:85:5 - | -LL | let _ = &{ ATOMIC_TUPLE }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: a `const` item with interior mutability should not be borrowed --> $DIR/others.rs:87:5 | @@ -136,5 +111,5 @@ LL | assert_eq!(CELL.get(), 6); //~ ERROR interior mutability | = help: assign this const to a local or static variable, and use the variable here -error: aborting due to 17 previous errors +error: aborting due to 14 previous errors diff --git a/tests/ui/box_vec.stderr b/tests/ui/box_vec.stderr index a4983df1d307..fca12eddd573 100644 --- a/tests/ui/box_vec.stderr +++ b/tests/ui/box_vec.stderr @@ -1,16 +1,3 @@ -error: non-binding let on a type that implements `Drop` - --> $DIR/box_vec.rs:7:9 - | -LL | let _: Box<$x> = Box::new($init); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -... -LL | boxit!(Vec::new(), Vec); - | ---------------------------- in this macro invocation - | - = 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` - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) - error: you seem to be trying to use `Box>`. Consider using just `Vec` --> $DIR/box_vec.rs:14:18 | @@ -20,5 +7,5 @@ LL | pub fn test(foo: Box>) { = note: `-D clippy::box-vec` implied by `-D warnings` = help: `Vec` is already on the heap, `Box>` makes an extra allocation. -error: aborting due to 2 previous errors +error: aborting due to previous error diff --git a/tests/ui/crashes/ice-4968.stderr b/tests/ui/crashes/ice-4968.stderr deleted file mode 100644 index 9ce39027451d..000000000000 --- a/tests/ui/crashes/ice-4968.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: non-binding let on a type that implements `Drop` - --> $DIR/ice-4968.rs:16:9 - | -LL | let _: Vec> = mem::transmute(slice); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: aborting due to previous error - diff --git a/tests/ui/crashes/ice-5223.stderr b/tests/ui/crashes/ice-5223.stderr deleted file mode 100644 index 3ae2dd5f7705..000000000000 --- a/tests/ui/crashes/ice-5223.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: non-binding let on a type that implements `Drop` - --> $DIR/ice-5223.rs:14:9 - | -LL | let _ = self.arr.iter().cloned().collect::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: aborting due to previous error - diff --git a/tests/ui/escape_analysis.stderr b/tests/ui/escape_analysis.stderr index 6e1c1c07b6ea..c86a769a3da4 100644 --- a/tests/ui/escape_analysis.stderr +++ b/tests/ui/escape_analysis.stderr @@ -12,26 +12,5 @@ error: local variable doesn't need to be boxed here LL | pub fn new(_needs_name: Box>) -> () {} | ^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/escape_analysis.rs:166:9 - | -LL | / let _ = move || { -LL | | consume(x); -LL | | }; - | |__________^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: non-binding let on a type that implements `Drop` - --> $DIR/escape_analysis.rs:172:9 - | -LL | / let _ = || { -LL | | borrow(&x); -LL | | }; - | |__________^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors diff --git a/tests/ui/eta.stderr b/tests/ui/eta.stderr index bc79caee887f..c4713ca8083d 100644 --- a/tests/ui/eta.stderr +++ b/tests/ui/eta.stderr @@ -64,15 +64,6 @@ error: redundant closure found LL | let e: std::vec::Vec = vec!['a', 'b', 'c'].iter().map(|c| c.to_ascii_uppercase()).collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `char::to_ascii_uppercase` -error: non-binding let on a type that implements `Drop` - --> $DIR/eta.rs:107:5 - | -LL | let _: Vec<_> = arr.iter().map(|x| x.map_err(|e| some.take().unwrap()(e))).collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: redundant closure found --> $DIR/eta.rs:172:27 | @@ -85,13 +76,5 @@ error: redundant closure found LL | let a = Some(1u8).map(|a| closure(a)); | ^^^^^^^^^^^^^^ help: remove closure as shown: `closure` -error: non-binding let on a type that implements `Drop` - --> $DIR/eta.rs:203:5 - | -LL | let _ = [Bar].iter().map(|s| s.to_string()).collect::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: aborting due to 14 previous errors +error: aborting due to 12 previous errors diff --git a/tests/ui/filter_methods.stderr b/tests/ui/filter_methods.stderr index 08b781d73634..b5ac90282dc9 100644 --- a/tests/ui/filter_methods.stderr +++ b/tests/ui/filter_methods.stderr @@ -1,4 +1,4 @@ -error: non-binding let on a type that implements `Drop` +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(); @@ -16,7 +16,7 @@ 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` +error: non-binding `let` on a type that implements `Drop` --> $DIR/filter_methods.rs:7:5 | LL | / let _: Vec<_> = vec![5_i8; 6] @@ -40,7 +40,7 @@ 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` +error: non-binding `let` on a type that implements `Drop` --> $DIR/filter_methods.rs:13:5 | LL | / let _: Vec<_> = vec![5_i8; 6] @@ -64,7 +64,7 @@ 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` +error: non-binding `let` on a type that implements `Drop` --> $DIR/filter_methods.rs:19:5 | LL | / let _: Vec<_> = vec![5_i8; 6] diff --git a/tests/ui/get_unwrap.stderr b/tests/ui/get_unwrap.stderr index 6aa5452bac1c..76a098df82aa 100644 --- a/tests/ui/get_unwrap.stderr +++ b/tests/ui/get_unwrap.stderr @@ -70,34 +70,17 @@ error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and LL | *some_vecdeque.get_mut(0).unwrap() = 1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vecdeque[0]` -error: non-binding let on a type that implements `Drop` - --> $DIR/get_unwrap.rs:59:9 - | -LL | let _ = some_vec.get(0..1).unwrap().to_vec(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise --> $DIR/get_unwrap.rs:59:17 | LL | let _ = some_vec.get(0..1).unwrap().to_vec(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]` -error: non-binding let on a type that implements `Drop` - --> $DIR/get_unwrap.rs:60:9 - | -LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise --> $DIR/get_unwrap.rs:60:17 | LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]` -error: aborting due to 15 previous errors +error: aborting due to 13 previous errors diff --git a/tests/ui/into_iter_on_ref.stderr b/tests/ui/into_iter_on_ref.stderr index efe9d20920b7..28003b365bbd 100644 --- a/tests/ui/into_iter_on_ref.stderr +++ b/tests/ui/into_iter_on_ref.stderr @@ -1,12 +1,3 @@ -error: non-binding let on a type that implements `Drop` - --> $DIR/into_iter_on_ref.rs:13:5 - | -LL | let _ = vec![1, 2, 3].into_iter(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` --> $DIR/into_iter_on_ref.rs:14:30 | @@ -171,5 +162,5 @@ error: this `.into_iter()` call is equivalent to `.iter()` and will not consume LL | let _ = (&[1, 2, 3]).into_iter().next(); //~ WARN equivalent to .iter() | ^^^^^^^^^ help: call directly: `iter` -error: aborting due to 28 previous errors +error: aborting due to 27 previous errors diff --git a/tests/ui/iter_cloned_collect.stderr b/tests/ui/iter_cloned_collect.stderr index f5cd43b3da54..b90a1e6c9196 100644 --- a/tests/ui/iter_cloned_collect.stderr +++ b/tests/ui/iter_cloned_collect.stderr @@ -6,33 +6,12 @@ LL | let v2: Vec = v.iter().cloned().collect(); | = note: `-D clippy::iter-cloned-collect` implied by `-D warnings` -error: non-binding let on a type that implements `Drop` - --> $DIR/iter_cloned_collect.rs:15:5 - | -LL | let _: Vec = vec![1, 2, 3].iter().cloned().collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable --> $DIR/iter_cloned_collect.rs:15:38 | LL | let _: Vec = vec![1, 2, 3].iter().cloned().collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` -error: non-binding let on a type that implements `Drop` - --> $DIR/iter_cloned_collect.rs:19:9 - | -LL | / let _: Vec = std::ffi::CStr::from_ptr(std::ptr::null()) -LL | | .to_bytes() -LL | | .iter() -LL | | .cloned() -LL | | .collect(); - | |_______________________^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable --> $DIR/iter_cloned_collect.rs:20:24 | @@ -43,5 +22,5 @@ LL | | .cloned() LL | | .collect(); | |______________________^ help: try: `.to_vec()` -error: aborting due to 5 previous errors +error: aborting due to 3 previous errors diff --git a/tests/ui/let_underscore_drop.stderr b/tests/ui/let_underscore_drop.stderr index 6dc8904c4fe9..66069e0c5e13 100644 --- a/tests/ui/let_underscore_drop.stderr +++ b/tests/ui/let_underscore_drop.stderr @@ -1,4 +1,4 @@ -error: non-binding let on a type that implements `Drop` +error: non-binding `let` on a type that implements `Drop` --> $DIR/let_underscore_drop.rs:16:5 | LL | let _ = Box::new(()); @@ -7,7 +7,7 @@ LL | let _ = Box::new(()); = 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: non-binding let on a type that implements `Drop` +error: non-binding `let` on a type that implements `Drop` --> $DIR/let_underscore_drop.rs:17:5 | LL | let _ = Droppable; @@ -15,7 +15,7 @@ LL | let _ = Droppable; | = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` -error: non-binding let on a type that implements `Drop` +error: non-binding `let` on a type that implements `Drop` --> $DIR/let_underscore_drop.rs:18:5 | LL | let _ = Some(Droppable); diff --git a/tests/ui/map_clone.fixed b/tests/ui/map_clone.fixed index 6e3a8e67e811..ce92b3c0c303 100644 --- a/tests/ui/map_clone.fixed +++ b/tests/ui/map_clone.fixed @@ -2,6 +2,7 @@ #![warn(clippy::all, clippy::pedantic)] #![allow(clippy::iter_cloned_collect)] #![allow(clippy::clone_on_copy, clippy::redundant_clone)] +#![allow(clippy::let_underscore_drop)] #![allow(clippy::missing_docs_in_private_items)] #![allow(clippy::redundant_closure_for_method_calls)] #![allow(clippy::many_single_char_names)] diff --git a/tests/ui/map_clone.rs b/tests/ui/map_clone.rs index 6fd395710d4b..324c776c3c9a 100644 --- a/tests/ui/map_clone.rs +++ b/tests/ui/map_clone.rs @@ -2,6 +2,7 @@ #![warn(clippy::all, clippy::pedantic)] #![allow(clippy::iter_cloned_collect)] #![allow(clippy::clone_on_copy, clippy::redundant_clone)] +#![allow(clippy::let_underscore_drop)] #![allow(clippy::missing_docs_in_private_items)] #![allow(clippy::redundant_closure_for_method_calls)] #![allow(clippy::many_single_char_names)] diff --git a/tests/ui/map_clone.stderr b/tests/ui/map_clone.stderr index 122a678f1188..d84a5bf8d4de 100644 --- a/tests/ui/map_clone.stderr +++ b/tests/ui/map_clone.stderr @@ -1,97 +1,40 @@ -error: non-binding let on a type that implements `Drop` - --> $DIR/map_clone.rs:10:5 - | -LL | let _: Vec = vec![5_i8; 6].iter().map(|x| *x).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: you are using an explicit closure for copying elements - --> $DIR/map_clone.rs:10:22 + --> $DIR/map_clone.rs:11:22 | LL | let _: Vec = vec![5_i8; 6].iter().map(|x| *x).collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `vec![5_i8; 6].iter().copied()` | = note: `-D clippy::map-clone` implied by `-D warnings` -error: non-binding let on a type that implements `Drop` - --> $DIR/map_clone.rs:11:5 - | -LL | let _: Vec = vec![String::new()].iter().map(|x| x.clone()).collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: you are using an explicit closure for cloning elements - --> $DIR/map_clone.rs:11:26 + --> $DIR/map_clone.rs:12:26 | LL | let _: Vec = vec![String::new()].iter().map(|x| x.clone()).collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `vec![String::new()].iter().cloned()` -error: non-binding let on a type that implements `Drop` - --> $DIR/map_clone.rs:12:5 - | -LL | let _: Vec = vec![42, 43].iter().map(|&x| x).collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: you are using an explicit closure for copying elements - --> $DIR/map_clone.rs:12:23 + --> $DIR/map_clone.rs:13:23 | LL | let _: Vec = vec![42, 43].iter().map(|&x| x).collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `vec![42, 43].iter().copied()` error: you are using an explicit closure for copying elements - --> $DIR/map_clone.rs:14:26 + --> $DIR/map_clone.rs:15:26 | LL | let _: Option = Some(&16).map(|b| *b); | ^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `Some(&16).copied()` error: you are using an explicit closure for copying elements - --> $DIR/map_clone.rs:15:25 + --> $DIR/map_clone.rs:16:25 | LL | let _: Option = Some(&1).map(|x| x.clone()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `Some(&1).copied()` error: you are needlessly cloning iterator elements - --> $DIR/map_clone.rs:26:29 + --> $DIR/map_clone.rs:27:29 | LL | let _ = std::env::args().map(|v| v.clone()); | ^^^^^^^^^^^^^^^^^^^ help: remove the `map` call -error: non-binding let on a type that implements `Drop` - --> $DIR/map_clone.rs:35:9 - | -LL | let _: Vec = v.into_iter().map(|x| *x).collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: non-binding let on a type that implements `Drop` - --> $DIR/map_clone.rs:42:9 - | -LL | let _: Vec = v.into_iter().map(|x| *x).collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: non-binding let on a type that implements `Drop` - --> $DIR/map_clone.rs:45:9 - | -LL | let _: Vec = v.into_iter().map(|&mut x| x).collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: non-binding let on a type that implements `Drop` - --> $DIR/map_clone.rs:53:9 - | -LL | let _: Vec<_> = items.into_iter().map(|x| x.clone()).collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: aborting due to 13 previous errors +error: aborting due to 6 previous errors diff --git a/tests/ui/map_collect_result_unit.stderr b/tests/ui/map_collect_result_unit.stderr index 26e876b18081..8b06e13baa6b 100644 --- a/tests/ui/map_collect_result_unit.stderr +++ b/tests/ui/map_collect_result_unit.stderr @@ -12,22 +12,5 @@ error: `.map().collect()` can be replaced with `.try_for_each()` LL | let _: Result<(), _> = (0..3).map(|t| Err(t + 1)).collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `(0..3).try_for_each(|t| Err(t + 1))` -error: non-binding let on a type that implements `Drop` - --> $DIR/map_collect_result_unit.rs:14:5 - | -LL | let _ = (0..3).map(|t| Err(t + 1)).collect::, _>>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: non-binding let on a type that implements `Drop` - --> $DIR/map_collect_result_unit.rs:15:5 - | -LL | let _ = (0..3).map(|t| Err(t + 1)).collect::>>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors diff --git a/tests/ui/map_flatten.fixed b/tests/ui/map_flatten.fixed index a5fdf7df613d..a7ab5a12cb76 100644 --- a/tests/ui/map_flatten.fixed +++ b/tests/ui/map_flatten.fixed @@ -1,6 +1,7 @@ // run-rustfix #![warn(clippy::all, clippy::pedantic)] +#![allow(clippy::let_underscore_drop)] #![allow(clippy::missing_docs_in_private_items)] #![allow(clippy::map_identity)] diff --git a/tests/ui/map_flatten.rs b/tests/ui/map_flatten.rs index abbc4e16e567..e364a05f3760 100644 --- a/tests/ui/map_flatten.rs +++ b/tests/ui/map_flatten.rs @@ -1,6 +1,7 @@ // run-rustfix #![warn(clippy::all, clippy::pedantic)] +#![allow(clippy::let_underscore_drop)] #![allow(clippy::missing_docs_in_private_items)] #![allow(clippy::map_identity)] diff --git a/tests/ui/map_flatten.stderr b/tests/ui/map_flatten.stderr index 6159b5256ee8..d4e27f9aa075 100644 --- a/tests/ui/map_flatten.stderr +++ b/tests/ui/map_flatten.stderr @@ -1,81 +1,40 @@ -error: non-binding let on a type that implements `Drop` - --> $DIR/map_flatten.rs:14:5 - | -LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id).flatten().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 `map(..).flatten()` on an `Iterator` - --> $DIR/map_flatten.rs:14:46 + --> $DIR/map_flatten.rs:15:46 | LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id).flatten().collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id)` | = note: `-D clippy::map-flatten` implied by `-D warnings` -error: non-binding let on a type that implements `Drop` - --> $DIR/map_flatten.rs:15:5 - | -LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_ref).flatten().collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: called `map(..).flatten()` on an `Iterator` - --> $DIR/map_flatten.rs:15:46 + --> $DIR/map_flatten.rs:16:46 | LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_ref).flatten().collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id_ref)` -error: non-binding let on a type that implements `Drop` - --> $DIR/map_flatten.rs:16:5 - | -LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_closure).flatten().collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: called `map(..).flatten()` on an `Iterator` - --> $DIR/map_flatten.rs:16:46 + --> $DIR/map_flatten.rs:17:46 | LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_closure).flatten().collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id_closure)` -error: non-binding let on a type that implements `Drop` - --> $DIR/map_flatten.rs:17:5 - | -LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| x.checked_add(1)).flatten().collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: called `map(..).flatten()` on an `Iterator` - --> $DIR/map_flatten.rs:17:46 + --> $DIR/map_flatten.rs:18:46 | LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| x.checked_add(1)).flatten().collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(|x| x.checked_add(1))` -error: non-binding let on a type that implements `Drop` - --> $DIR/map_flatten.rs:20:5 - | -LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: called `map(..).flatten()` on an `Iterator` - --> $DIR/map_flatten.rs:20:46 + --> $DIR/map_flatten.rs:21:46 | LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect(); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `flat_map` instead: `.flat_map(|x| 0..x)` error: called `map(..).flatten()` on an `Option` - --> $DIR/map_flatten.rs:23:39 + --> $DIR/map_flatten.rs:24:39 | LL | let _: Option<_> = (Some(Some(1))).map(|x| x).flatten(); | ^^^^^^^^^^^^^^^^^^^^^ help: try using `and_then` instead: `.and_then(|x| x)` -error: aborting due to 11 previous errors +error: aborting due to 6 previous errors diff --git a/tests/ui/map_identity.stderr b/tests/ui/map_identity.stderr index 6bfeb186badc..e4a0320cbda5 100644 --- a/tests/ui/map_identity.stderr +++ b/tests/ui/map_identity.stderr @@ -1,12 +1,3 @@ -error: non-binding let on a type that implements `Drop` - --> $DIR/map_identity.rs:8:5 - | -LL | let _: Vec<_> = x.iter().map(not_identity).map(|x| return x).collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: unnecessary map of the identity function --> $DIR/map_identity.rs:8:47 | @@ -15,14 +6,6 @@ LL | let _: Vec<_> = x.iter().map(not_identity).map(|x| return x).collect(); | = note: `-D clippy::map-identity` implied by `-D warnings` -error: non-binding let on a type that implements `Drop` - --> $DIR/map_identity.rs:9:5 - | -LL | let _: Vec<_> = x.iter().map(std::convert::identity).map(|y| y).collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: unnecessary map of the identity function --> $DIR/map_identity.rs:9:57 | @@ -50,21 +33,5 @@ LL | | return x; LL | | }); | |______^ help: remove the call to `map` -error: non-binding let on a type that implements `Drop` - --> $DIR/map_identity.rs:15:5 - | -LL | let _: Vec<_> = x.iter().map(|x| 2 * x).collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: non-binding let on a type that implements `Drop` - --> $DIR/map_identity.rs:16:5 - | -LL | let _: Vec<_> = x.iter().map(not_identity).map(|x| return x - 4).collect(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: aborting due to 9 previous errors +error: aborting due to 5 previous errors diff --git a/tests/ui/match_single_binding.stderr b/tests/ui/match_single_binding.stderr index 8b07599817b6..795c8c3e24d7 100644 --- a/tests/ui/match_single_binding.stderr +++ b/tests/ui/match_single_binding.stderr @@ -150,20 +150,6 @@ LL | let Point { x, y } = coords(); LL | let product = x * y; | -error: non-binding let on a type that implements `Drop` - --> $DIR/match_single_binding.rs:96:5 - | -LL | / let _ = v -LL | | .iter() -LL | | .map(|i| match i.unwrap() { -LL | | unwrapped => unwrapped, -LL | | }) -LL | | .collect::>(); - | |______________________________^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: this match could be written as a `let` statement --> $DIR/match_single_binding.rs:98:18 | @@ -181,5 +167,5 @@ LL | unwrapped LL | }) | -error: aborting due to 12 previous errors +error: aborting due to 11 previous errors diff --git a/tests/ui/needless_pass_by_value.stderr b/tests/ui/needless_pass_by_value.stderr index cf04ee4b2572..9aa783bf904e 100644 --- a/tests/ui/needless_pass_by_value.stderr +++ b/tests/ui/needless_pass_by_value.stderr @@ -90,15 +90,6 @@ help: change `v.clone()` to LL | let _ = v.to_owned(); | ^^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/needless_pass_by_value.rs:85:5 - | -LL | let _ = v.clone(); - | ^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: this argument is passed by value, but not consumed in the function body --> $DIR/needless_pass_by_value.rs:94:12 | @@ -183,5 +174,5 @@ error: this argument is passed by value, but not consumed in the function body LL | fn more_fun(_item: impl Club<'static, i32>) {} | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>` -error: aborting due to 23 previous errors +error: aborting due to 22 previous errors diff --git a/tests/ui/redundant_clone.stderr b/tests/ui/redundant_clone.stderr index 270c3fac9909..89b392542991 100644 --- a/tests/ui/redundant_clone.stderr +++ b/tests/ui/redundant_clone.stderr @@ -167,14 +167,5 @@ note: cloned value is neither consumed nor mutated LL | let y = x.clone().join("matthias"); | ^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/redundant_clone.rs:180:5 - | -LL | let _ = a.clone(); // OK - | ^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - -error: aborting due to 15 previous errors +error: aborting due to 14 previous errors diff --git a/tests/ui/reversed_empty_ranges_fixable.stderr b/tests/ui/reversed_empty_ranges_fixable.stderr index 707a5d5032ec..de83c4f3d633 100644 --- a/tests/ui/reversed_empty_ranges_fixable.stderr +++ b/tests/ui/reversed_empty_ranges_fixable.stderr @@ -10,15 +10,6 @@ help: consider using the following if you are attempting to iterate over this ra LL | (21..=42).rev().for_each(|x| println!("{}", x)); | ^^^^^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/reversed_empty_ranges_fixable.rs:10:5 - | -LL | let _ = (ANSWER..21).filter(|x| x % 2 == 0).take(10).collect::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: this range is empty so it will yield no values --> $DIR/reversed_empty_ranges_fixable.rs:10:13 | @@ -52,5 +43,5 @@ help: consider using the following if you are attempting to iterate over this ra LL | for _ in (21u32..42u32).rev() {} | ^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors diff --git a/tests/ui/transmute.stderr b/tests/ui/transmute.stderr index d6767dc9f156..ad9953d12bcc 100644 --- a/tests/ui/transmute.stderr +++ b/tests/ui/transmute.stderr @@ -24,71 +24,30 @@ error: transmute from a reference to a pointer LL | let _: *const U = core::intrinsics::transmute(t); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T as *const U` -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute.rs:34:9 - | -LL | let _: Vec = core::intrinsics::transmute(my_vec()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from a type (`std::vec::Vec`) to itself --> $DIR/transmute.rs:34:27 | LL | let _: Vec = core::intrinsics::transmute(my_vec()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute.rs:36:9 - | -LL | let _: Vec = core::mem::transmute(my_vec()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from a type (`std::vec::Vec`) to itself --> $DIR/transmute.rs:36:27 | LL | let _: Vec = core::mem::transmute(my_vec()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute.rs:38:9 - | -LL | let _: Vec = std::intrinsics::transmute(my_vec()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from a type (`std::vec::Vec`) to itself --> $DIR/transmute.rs:38:27 | LL | let _: Vec = std::intrinsics::transmute(my_vec()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute.rs:40:9 - | -LL | let _: Vec = std::mem::transmute(my_vec()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from a type (`std::vec::Vec`) to itself --> $DIR/transmute.rs:40:27 | LL | let _: Vec = std::mem::transmute(my_vec()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute.rs:42:9 - | -LL | let _: Vec = my_transmute(my_vec()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from a type (`std::vec::Vec`) to itself --> $DIR/transmute.rs:42:27 | @@ -195,5 +154,5 @@ error: transmute from a `&mut [u8]` to a `&mut str` LL | let _: &mut str = unsafe { std::mem::transmute(mb) }; | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()` -error: aborting due to 29 previous errors +error: aborting due to 24 previous errors diff --git a/tests/ui/transmute_collection.stderr b/tests/ui/transmute_collection.stderr index e89f6d8539f2..ebc05c402abf 100644 --- a/tests/ui/transmute_collection.stderr +++ b/tests/ui/transmute_collection.stderr @@ -1,12 +1,3 @@ -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute_collection.rs:9:9 - | -LL | let _ = transmute::<_, Vec>(vec![0u8]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from `std::vec::Vec` to `std::vec::Vec` with mismatched layout is unsound --> $DIR/transmute_collection.rs:9:17 | @@ -15,42 +6,18 @@ LL | let _ = transmute::<_, Vec>(vec![0u8]); | = note: `-D clippy::unsound-collection-transmute` implied by `-D warnings` -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute_collection.rs:11:9 - | -LL | let _ = transmute::<_, Vec<[u8; 4]>>(vec![1234u32]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from `std::vec::Vec` to `std::vec::Vec<[u8; 4]>` with mismatched layout is unsound --> $DIR/transmute_collection.rs:11:17 | LL | let _ = transmute::<_, Vec<[u8; 4]>>(vec![1234u32]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute_collection.rs:14:9 - | -LL | let _ = transmute::<_, VecDeque>(VecDeque::::new()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from `std::collections::VecDeque` to `std::collections::VecDeque` with mismatched layout is unsound --> $DIR/transmute_collection.rs:14:17 | LL | let _ = transmute::<_, VecDeque>(VecDeque::::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute_collection.rs:16:9 - | -LL | let _ = transmute::<_, VecDeque>(VecDeque::<[u8; 4]>::new()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from `std::collections::VecDeque<[u8; 4]>` to `std::collections::VecDeque` with mismatched layout is unsound --> $DIR/transmute_collection.rs:16:17 | @@ -93,56 +60,24 @@ error: transmute from `std::collections::HashSet<[u8; 4]>` to `std::collections: LL | let _ = transmute::<_, HashSet>(HashSet::<[u8; 4]>::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute_collection.rs:34:9 - | -LL | let _ = transmute::<_, BTreeMap>(BTreeMap::::new()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from `std::collections::BTreeMap` to `std::collections::BTreeMap` with mismatched layout is unsound --> $DIR/transmute_collection.rs:34:17 | LL | let _ = transmute::<_, BTreeMap>(BTreeMap::::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute_collection.rs:35:9 - | -LL | let _ = transmute::<_, BTreeMap>(BTreeMap::::new()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from `std::collections::BTreeMap` to `std::collections::BTreeMap` with mismatched layout is unsound --> $DIR/transmute_collection.rs:35:17 | LL | let _ = transmute::<_, BTreeMap>(BTreeMap::::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute_collection.rs:37:9 - | -LL | let _ = transmute::<_, BTreeMap>(BTreeMap::::new()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from `std::collections::BTreeMap` to `std::collections::BTreeMap` with mismatched layout is unsound --> $DIR/transmute_collection.rs:37:17 | LL | let _ = transmute::<_, BTreeMap>(BTreeMap::::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: non-binding let on a type that implements `Drop` - --> $DIR/transmute_collection.rs:38:9 - | -LL | let _ = transmute::<_, BTreeMap>(BTreeMap::<[u8; 4], u32>::new()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: transmute from `std::collections::BTreeMap<[u8; 4], u32>` to `std::collections::BTreeMap` with mismatched layout is unsound --> $DIR/transmute_collection.rs:38:17 | @@ -173,5 +108,5 @@ error: transmute from `std::collections::HashMap<[u8; 4], u32>` to `std::collect LL | let _ = transmute::<_, HashMap>(HashMap::<[u8; 4], u32>::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 26 previous errors +error: aborting due to 18 previous errors diff --git a/tests/ui/unnecessary_clone.stderr b/tests/ui/unnecessary_clone.stderr index 1f89cb0cdef2..5ffa6c4fd061 100644 --- a/tests/ui/unnecessary_clone.stderr +++ b/tests/ui/unnecessary_clone.stderr @@ -24,15 +24,6 @@ error: using `.clone()` on a ref-counted pointer LL | arc_weak.clone(); | ^^^^^^^^^^^^^^^^ help: try this: `Weak::::clone(&arc_weak)` -error: non-binding let on a type that implements `Drop` - --> $DIR/unnecessary_clone.rs:36:5 - | -LL | let _: Arc = x.clone(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: using `.clone()` on a ref-counted pointer --> $DIR/unnecessary_clone.rs:36:33 | @@ -111,5 +102,5 @@ error: using `.clone()` on a ref-counted pointer LL | Some(try_opt!(Some(rc)).clone()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `Rc::::clone(&try_opt!(Some(rc)))` -error: aborting due to 13 previous errors +error: aborting due to 12 previous errors diff --git a/tests/ui/useless_conversion.stderr b/tests/ui/useless_conversion.stderr index ea3e96111cb3..11c6efb25cce 100644 --- a/tests/ui/useless_conversion.stderr +++ b/tests/ui/useless_conversion.stderr @@ -52,15 +52,6 @@ error: useless conversion to the same type: `std::str::Lines` LL | let _ = "".lines().into_iter(); | ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `"".lines()` -error: non-binding let on a type that implements `Drop` - --> $DIR/useless_conversion.rs:65:5 - | -LL | let _ = vec![1, 2, 3].into_iter().into_iter(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::let_underscore_drop)]` on by default - = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop` - error: useless conversion to the same type: `std::vec::IntoIter` --> $DIR/useless_conversion.rs:65:13 | @@ -79,5 +70,5 @@ error: useless conversion to the same type: `i32` LL | let _ = i32::from(a + b) * 3; | ^^^^^^^^^^^^^^^^ help: consider removing `i32::from()`: `(a + b)` -error: aborting due to 12 previous errors +error: aborting due to 11 previous errors