diff --git a/tests/compile-fail-fullmir/ptr_offset_overflow.rs b/tests/compile-fail-fullmir/ptr_offset_overflow.rs index 32ab2daebf0..babd0246e7e 100644 --- a/tests/compile-fail-fullmir/ptr_offset_overflow.rs +++ b/tests/compile-fail-fullmir/ptr_offset_overflow.rs @@ -2,5 +2,5 @@ fn main() { let v = [1i8, 2]; let x = &v[1] as *const i8; - let _ = unsafe { x.offset(isize::min_value()) }; + let _val = unsafe { x.offset(isize::min_value()) }; } diff --git a/tests/compile-fail/invalid_enum_discriminant.rs b/tests/compile-fail/invalid_enum_discriminant.rs index bd5cb55b6c9..c1b8727c129 100644 --- a/tests/compile-fail/invalid_enum_discriminant.rs +++ b/tests/compile-fail/invalid_enum_discriminant.rs @@ -12,5 +12,5 @@ pub enum Foo { fn main() { let f = unsafe { std::mem::transmute::(42) }; - let _ = mem::discriminant(&f); + let _val = mem::discriminant(&f); } diff --git a/tests/compile-fail/pointer_byte_read_1.rs b/tests/compile-fail/pointer_byte_read_1.rs index b25f09d485f..a584863654c 100644 --- a/tests/compile-fail/pointer_byte_read_1.rs +++ b/tests/compile-fail/pointer_byte_read_1.rs @@ -3,5 +3,5 @@ fn main() { let y = &x; let z = &y as *const &i32 as *const usize; let ptr_bytes = unsafe { *z }; // the actual deref is fine, because we read the entire pointer at once - let _ = ptr_bytes / 432; //~ ERROR invalid arithmetic on pointers that would leak base addresses + let _val = ptr_bytes / 432; //~ ERROR invalid arithmetic on pointers that would leak base addresses } diff --git a/tests/compile-fail/pointer_byte_read_2.rs b/tests/compile-fail/pointer_byte_read_2.rs index 5df8c4782c7..ddb9bc1f995 100644 --- a/tests/compile-fail/pointer_byte_read_2.rs +++ b/tests/compile-fail/pointer_byte_read_2.rs @@ -3,5 +3,5 @@ fn main() { let y = &x; let z = &y as *const &i32 as *const u8; // the deref fails, because we are reading only a part of the pointer - let _ = unsafe { *z }; //~ ERROR tried to access part of a pointer value as raw bytes + let _val = unsafe { *z }; //~ ERROR tried to access part of a pointer value as raw bytes } diff --git a/tests/compile-fail/ptr_bitops2.rs b/tests/compile-fail/ptr_bitops2.rs index 233c9a733c9..5d5eab15508 100644 --- a/tests/compile-fail/ptr_bitops2.rs +++ b/tests/compile-fail/ptr_bitops2.rs @@ -1,5 +1,5 @@ fn main() { let val = 13usize; let addr = &val as *const _ as usize; - let _ = addr & 13; //~ ERROR access part of a pointer value as raw bytes + let _val = addr & 13; //~ ERROR access part of a pointer value as raw bytes } diff --git a/tests/compile-fail/ptr_int_cast.rs b/tests/compile-fail/ptr_int_cast.rs index 576f0c333d1..a823a0f49b6 100644 --- a/tests/compile-fail/ptr_int_cast.rs +++ b/tests/compile-fail/ptr_int_cast.rs @@ -4,5 +4,5 @@ fn main() { let x = x as *const i32; let x = x as u8; //~ ERROR a raw memory access tried to access part of a pointer value as raw bytes let x = x as *const i32; - let _ = unsafe { *x }; + let _val = unsafe { *x }; } diff --git a/tests/compile-fail/ptr_offset_int_plus_int.rs b/tests/compile-fail/ptr_offset_int_plus_int.rs index fa4efa32365..d0273961081 100644 --- a/tests/compile-fail/ptr_offset_int_plus_int.rs +++ b/tests/compile-fail/ptr_offset_int_plus_int.rs @@ -3,6 +3,6 @@ fn main() { // Can't offset an integer pointer by non-zero offset. unsafe { - let _ = (1 as *mut u8).offset(1); + let _val = (1 as *mut u8).offset(1); } } diff --git a/tests/compile-fail/ptr_offset_int_plus_ptr.rs b/tests/compile-fail/ptr_offset_int_plus_ptr.rs index b4554893580..b49c758c72f 100644 --- a/tests/compile-fail/ptr_offset_int_plus_ptr.rs +++ b/tests/compile-fail/ptr_offset_int_plus_ptr.rs @@ -4,6 +4,6 @@ fn main() { let ptr = Box::into_raw(Box::new(0u32)); // Can't start with an integer pointer and get to something usable unsafe { - let _ = (1 as *mut u8).offset(ptr as isize); + let _val = (1 as *mut u8).offset(ptr as isize); } } diff --git a/tests/compile-fail/ptr_rem.rs b/tests/compile-fail/ptr_rem.rs index 8a3665872f7..dfc91e9dc1b 100644 --- a/tests/compile-fail/ptr_rem.rs +++ b/tests/compile-fail/ptr_rem.rs @@ -1,5 +1,5 @@ fn main() { let val = 13usize; let addr = &val as *const _ as usize; - let _ = addr % 16; //~ ERROR access part of a pointer value as raw bytes + let _val = addr % 16; //~ ERROR access part of a pointer value as raw bytes } diff --git a/tests/compile-fail/ptr_wrapping_offset_int_plus_ptr.rs b/tests/compile-fail/ptr_wrapping_offset_int_plus_ptr.rs index b3dda27fad1..eacb9f07fff 100644 --- a/tests/compile-fail/ptr_wrapping_offset_int_plus_ptr.rs +++ b/tests/compile-fail/ptr_wrapping_offset_int_plus_ptr.rs @@ -4,5 +4,5 @@ fn main() { let ptr = Box::into_raw(Box::new(0u32)); // Can't start with an integer pointer and get to something usable let ptr = (1 as *mut u8).wrapping_offset(ptr as isize); - let _ = unsafe { *ptr }; + let _val = unsafe { *ptr }; } diff --git a/tests/compile-fail/transmute_fat1.rs b/tests/compile-fail/transmute_fat1.rs index ede0486be41..ddc78c8bf1d 100644 --- a/tests/compile-fail/transmute_fat1.rs +++ b/tests/compile-fail/transmute_fat1.rs @@ -10,5 +10,5 @@ fn main() { let bad = unsafe { std::mem::transmute::<&[u8], [u8; 8]>(&[1u8]) }; - let _ = bad[0] + bad[bad.len()-1]; //~ ERROR a raw memory access tried to access part of a pointer value as raw bytes + let _val = bad[0] + bad[bad.len()-1]; //~ ERROR a raw memory access tried to access part of a pointer value as raw bytes } diff --git a/tests/compile-fail/validity/invalid_char.rs b/tests/compile-fail/validity/invalid_char.rs index 0d75ad9d289..a3f90703634 100644 --- a/tests/compile-fail/validity/invalid_char.rs +++ b/tests/compile-fail/validity/invalid_char.rs @@ -1,6 +1,6 @@ fn main() { assert!(std::char::from_u32(-1_i32 as u32).is_none()); - let _ = match unsafe { std::mem::transmute::(-1) } { //~ ERROR encountered 4294967295, but expected something less or equal to 1114111 + let _val = match unsafe { std::mem::transmute::(-1) } { //~ ERROR encountered 4294967295, but expected something less or equal to 1114111 'a' => {true}, 'b' => {false}, _ => {true}, diff --git a/tests/compile-fail/zst.rs b/tests/compile-fail/zst.rs index 544d65a1bff..0488926870a 100644 --- a/tests/compile-fail/zst.rs +++ b/tests/compile-fail/zst.rs @@ -1,4 +1,4 @@ fn main() { let x = &() as *const () as *const i32; - let _ = unsafe { *x }; //~ ERROR access memory with alignment 1, but alignment 4 is required + let _val = unsafe { *x }; //~ ERROR access memory with alignment 1, but alignment 4 is required } diff --git a/tests/run-pass-fullmir/catch.rs b/tests/run-pass-fullmir/catch.rs index 960297daa7e..aa7bccaa5ff 100644 --- a/tests/run-pass-fullmir/catch.rs +++ b/tests/run-pass-fullmir/catch.rs @@ -3,6 +3,6 @@ use std::panic::{catch_unwind, AssertUnwindSafe}; fn main() { let mut i = 3; - let _ = catch_unwind(AssertUnwindSafe(|| {i -= 2;} )); + let _val = catch_unwind(AssertUnwindSafe(|| {i -= 2;} )); println!("{}", i); } diff --git a/tests/run-pass-fullmir/from_utf8.rs b/tests/run-pass-fullmir/from_utf8.rs index 69e6c521af6..ce59e60a932 100644 --- a/tests/run-pass-fullmir/from_utf8.rs +++ b/tests/run-pass-fullmir/from_utf8.rs @@ -1,3 +1,3 @@ fn main() { - let _ = ::std::str::from_utf8(b"a"); + let _val = ::std::str::from_utf8(b"a"); } diff --git a/tests/run-pass-fullmir/threads.rs b/tests/run-pass-fullmir/threads.rs index f920bc52edd..dad47d85a24 100644 --- a/tests/run-pass-fullmir/threads.rs +++ b/tests/run-pass-fullmir/threads.rs @@ -5,15 +5,15 @@ use std::sync; fn main() { let m = sync::Mutex::new(0); - let _ = m.lock(); + drop(m.lock()); drop(m); // We don't provide RwLock on Windows #[cfg(not(target_os = "windows"))] { let rw = sync::RwLock::new(0); - let _ = rw.read(); - let _ = rw.write(); + drop(rw.read()); + drop(rw.write()); drop(rw); } } diff --git a/tests/run-pass/closure-drop.rs b/tests/run-pass/closure-drop.rs index f1bdafaeb13..374efb6032b 100644 --- a/tests/run-pass/closure-drop.rs +++ b/tests/run-pass/closure-drop.rs @@ -17,7 +17,7 @@ fn main() { // this closure never by val uses its captures // so it's basically a fn(&self) // the shim used to not drop the `x` - let x = move || { let _ = x; }; + let x = move || { let _val = x; }; f(x); } assert!(ran_drop); diff --git a/tests/run-pass/drop_empty_slice.rs b/tests/run-pass/drop_empty_slice.rs index b21c8a612c5..8b481a0a2dd 100644 --- a/tests/run-pass/drop_empty_slice.rs +++ b/tests/run-pass/drop_empty_slice.rs @@ -3,5 +3,5 @@ fn main() { // With the nested Vec, this is calling Offset(Unique::empty(), 0) on drop. let args : Vec> = Vec::new(); - let _ = box args; + let _val = box args; } diff --git a/tests/run-pass/issue-20575.rs b/tests/run-pass/issue-20575.rs index 137d84c256b..01371f5bec6 100644 --- a/tests/run-pass/issue-20575.rs +++ b/tests/run-pass/issue-20575.rs @@ -13,5 +13,5 @@ fn main() { let functions: [Box Option<()>>; 1] = [Box::new(|| None)]; - let _: Option> = functions.iter().map(|f| (*f)()).collect(); + let _val: Option> = functions.iter().map(|f| (*f)()).collect(); } diff --git a/tests/run-pass/issue-26709.rs b/tests/run-pass/issue-26709.rs index 62626d75865..e29e5fbcc40 100644 --- a/tests/run-pass/issue-26709.rs +++ b/tests/run-pass/issue-26709.rs @@ -20,7 +20,7 @@ fn main() { let mut x = 0; { let wrapper = Box::new(Wrapper(&mut x, 123)); - let _: Box> = wrapper; + let _val: Box> = wrapper; } assert_eq!(432, x) } diff --git a/tests/run-pass/issue-33387.rs b/tests/run-pass/issue-33387.rs index edbf2b81ce9..62a4263c106 100644 --- a/tests/run-pass/issue-33387.rs +++ b/tests/run-pass/issue-33387.rs @@ -15,5 +15,5 @@ trait Foo {} impl Foo for [u8; 2] {} fn main() { - let _: Arc = Arc::new([3, 4]); + let _val: Arc = Arc::new([3, 4]); } diff --git a/tests/run-pass/issue-miri-184.rs b/tests/run-pass/issue-miri-184.rs index 24775fe8a2d..39c841403ef 100644 --- a/tests/run-pass/issue-miri-184.rs +++ b/tests/run-pass/issue-miri-184.rs @@ -1,4 +1,4 @@ pub fn main() { let bytes: [u8; 8] = unsafe { ::std::mem::transmute(0u64) }; - let _: &[u8] = &bytes; + let _val: &[u8] = &bytes; } diff --git a/tests/run-pass/sendable-class.rs b/tests/run-pass/sendable-class.rs index 66f0c84e23c..3280c36e0a7 100644 --- a/tests/run-pass/sendable-class.rs +++ b/tests/run-pass/sendable-class.rs @@ -27,6 +27,6 @@ fn foo(i:isize, j: char) -> Foo { pub fn main() { let (tx, rx) = channel(); - let _ = tx.send(foo(42, 'c')); - let _ = rx; + tx.send(foo(42, 'c')).unwrap(); + let _val = rx; } diff --git a/tests/run-pass/slices.rs b/tests/run-pass/slices.rs index 45a2a74db08..4506a72e8dd 100644 --- a/tests/run-pass/slices.rs +++ b/tests/run-pass/slices.rs @@ -4,7 +4,7 @@ fn slice_of_zst() { fn foo(v: &[T]) -> Option<&[T]> { let mut it = v.iter(); for _ in 0..5 { - let _ = it.next(); + it.next(); } Some(it.as_slice()) } @@ -12,7 +12,7 @@ fn slice_of_zst() { fn foo_mut(v: &mut [T]) -> Option<&mut [T]> { let mut it = v.iter_mut(); for _ in 0..5 { - let _ = it.next(); + it.next(); } Some(it.into_slice()) }