mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Update references
This commit is contained in:
parent
40d7af50ed
commit
06e81bb493
@ -22,15 +22,6 @@ error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
|
||||
LL | fn test4(a: &Box<bool>);
|
||||
| ^^^^^^^^^^ 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<T>`. Consider using just `&T`
|
||||
--> $DIR/borrow_box.rs:95:25
|
||||
|
|
||||
@ -73,5 +64,5 @@ error: you seem to be trying to use `&Box<T>`. 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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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<u8>);
|
||||
| ---------------------------- 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<Vec<T>>`. Consider using just `Vec<T>`
|
||||
--> $DIR/box_vec.rs:14:18
|
||||
|
|
||||
@ -20,5 +7,5 @@ LL | pub fn test(foo: Box<Vec<bool>>) {
|
||||
= note: `-D clippy::box-vec` implied by `-D warnings`
|
||||
= help: `Vec<T>` is already on the heap, `Box<Vec<T>>` makes an extra allocation.
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/ice-4968.rs:16:9
|
||||
|
|
||||
LL | let _: Vec<ManuallyDrop<T::Assoc>> = 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
|
||||
|
@ -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::<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: aborting due to previous error
|
||||
|
@ -12,26 +12,5 @@ error: local variable doesn't need to be boxed here
|
||||
LL | pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () {}
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
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
|
||||
|
||||
|
@ -64,15 +64,6 @@ error: redundant closure found
|
||||
LL | let e: std::vec::Vec<char> = 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::<Vec<_>>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= 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
|
||||
|
||||
|
@ -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]
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -6,33 +6,12 @@ LL | let v2: Vec<isize> = 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<isize> = 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<isize> = 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<u8> = 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
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)]
|
||||
|
@ -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)]
|
||||
|
@ -1,97 +1,40 @@
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/map_clone.rs:10:5
|
||||
|
|
||||
LL | let _: Vec<i8> = 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<i8> = 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<String> = 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<String> = 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<u32> = 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<u32> = 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<u64> = 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<u8> = 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<u32> = 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<u32> = 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<u32> = 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
|
||||
|
||||
|
@ -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::<Result<Vec<i32>, _>>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= 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::<Vec<Result<(), _>>>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= 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
|
||||
|
||||
|
@ -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)]
|
||||
|
||||
|
@ -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)]
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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::<Vec<u8>>();
|
||||
| |______________________________^
|
||||
|
|
||||
= 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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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::<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: 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
|
||||
|
||||
|
@ -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<i32> = 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<i32>`) to itself
|
||||
--> $DIR/transmute.rs:34:27
|
||||
|
|
||||
LL | let _: Vec<i32> = core::intrinsics::transmute(my_vec());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/transmute.rs:36:9
|
||||
|
|
||||
LL | let _: Vec<i32> = 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<i32>`) to itself
|
||||
--> $DIR/transmute.rs:36:27
|
||||
|
|
||||
LL | let _: Vec<i32> = core::mem::transmute(my_vec());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/transmute.rs:38:9
|
||||
|
|
||||
LL | let _: Vec<i32> = 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<i32>`) to itself
|
||||
--> $DIR/transmute.rs:38:27
|
||||
|
|
||||
LL | let _: Vec<i32> = std::intrinsics::transmute(my_vec());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/transmute.rs:40:9
|
||||
|
|
||||
LL | let _: Vec<i32> = 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<i32>`) to itself
|
||||
--> $DIR/transmute.rs:40:27
|
||||
|
|
||||
LL | let _: Vec<i32> = std::mem::transmute(my_vec());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/transmute.rs:42:9
|
||||
|
|
||||
LL | let _: Vec<i32> = 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<i32>`) 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
|
||||
|
||||
|
@ -1,12 +1,3 @@
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/transmute_collection.rs:9:9
|
||||
|
|
||||
LL | let _ = transmute::<_, Vec<u32>>(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<u8>` to `std::vec::Vec<u32>` with mismatched layout is unsound
|
||||
--> $DIR/transmute_collection.rs:9:17
|
||||
|
|
||||
@ -15,42 +6,18 @@ LL | let _ = transmute::<_, Vec<u32>>(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<u32>` 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<u32>>(VecDeque::<u8>::new());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
|
||||
|
||||
error: transmute from `std::collections::VecDeque<u8>` to `std::collections::VecDeque<u32>` with mismatched layout is unsound
|
||||
--> $DIR/transmute_collection.rs:14:17
|
||||
|
|
||||
LL | let _ = transmute::<_, VecDeque<u32>>(VecDeque::<u8>::new());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/transmute_collection.rs:16:9
|
||||
|
|
||||
LL | let _ = transmute::<_, VecDeque<u32>>(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<u32>` 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<u32>>(HashSet::<[u8; 4]>::new());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/transmute_collection.rs:34:9
|
||||
|
|
||||
LL | let _ = transmute::<_, BTreeMap<u8, u32>>(BTreeMap::<u8, u8>::new());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
|
||||
|
||||
error: transmute from `std::collections::BTreeMap<u8, u8>` to `std::collections::BTreeMap<u8, u32>` with mismatched layout is unsound
|
||||
--> $DIR/transmute_collection.rs:34:17
|
||||
|
|
||||
LL | let _ = transmute::<_, BTreeMap<u8, u32>>(BTreeMap::<u8, u8>::new());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/transmute_collection.rs:35:9
|
||||
|
|
||||
LL | let _ = transmute::<_, BTreeMap<u8, u32>>(BTreeMap::<u32, u32>::new());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
|
||||
|
||||
error: transmute from `std::collections::BTreeMap<u32, u32>` to `std::collections::BTreeMap<u8, u32>` with mismatched layout is unsound
|
||||
--> $DIR/transmute_collection.rs:35:17
|
||||
|
|
||||
LL | let _ = transmute::<_, BTreeMap<u8, u32>>(BTreeMap::<u32, u32>::new());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/transmute_collection.rs:37:9
|
||||
|
|
||||
LL | let _ = transmute::<_, BTreeMap<u8, u32>>(BTreeMap::<u8, [u8; 4]>::new());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
|
||||
|
||||
error: transmute from `std::collections::BTreeMap<u8, [u8; 4]>` to `std::collections::BTreeMap<u8, u32>` with mismatched layout is unsound
|
||||
--> $DIR/transmute_collection.rs:37:17
|
||||
|
|
||||
LL | let _ = transmute::<_, BTreeMap<u8, u32>>(BTreeMap::<u8, [u8; 4]>::new());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/transmute_collection.rs:38:9
|
||||
|
|
||||
LL | let _ = transmute::<_, BTreeMap<u32, u32>>(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<u32, u32>` 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<u32, u32>>(HashMap::<[u8; 4], u32>::new());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 26 previous errors
|
||||
error: aborting due to 18 previous errors
|
||||
|
||||
|
@ -24,15 +24,6 @@ error: using `.clone()` on a ref-counted pointer
|
||||
LL | arc_weak.clone();
|
||||
| ^^^^^^^^^^^^^^^^ help: try this: `Weak::<bool>::clone(&arc_weak)`
|
||||
|
||||
error: non-binding let on a type that implements `Drop`
|
||||
--> $DIR/unnecessary_clone.rs:36:5
|
||||
|
|
||||
LL | let _: Arc<dyn SomeTrait> = 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::<u8>::clone(&try_opt!(Some(rc)))`
|
||||
|
||||
error: aborting due to 13 previous errors
|
||||
error: aborting due to 12 previous errors
|
||||
|
||||
|
@ -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<i32>`
|
||||
--> $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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user