diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index 6efe95a9edce..71acede7e3eb 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -271,11 +271,11 @@ pub fn spin_loop() { crate::cfg_select! { target_arch = "x86" => { // SAFETY: the `cfg` attr ensures that we only execute this on x86 targets. - unsafe { crate::arch::x86::_mm_pause() } + crate::arch::x86::_mm_pause() } target_arch = "x86_64" => { // SAFETY: the `cfg` attr ensures that we only execute this on x86_64 targets. - unsafe { crate::arch::x86_64::_mm_pause() } + crate::arch::x86_64::_mm_pause() } target_arch = "riscv32" => crate::arch::riscv32::pause(), target_arch = "riscv64" => crate::arch::riscv64::pause(), diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse2.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse2.rs index 731d8b577637..242aa0e89f63 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse2.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse2.rs @@ -54,7 +54,7 @@ unsafe fn test_sse2() { } fn test_mm_pause() { - unsafe { _mm_pause() } + _mm_pause() } test_mm_pause(); diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86.rs index 90bcdba4353f..a18b6d01524e 100644 --- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86.rs +++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86.rs @@ -7,17 +7,13 @@ mod x86 { fn adc(c_in: u8, a: u32, b: u32) -> (u8, u32) { let mut sum = 0; - // SAFETY: There are no safety requirements for calling `_addcarry_u32`. - // It's just unsafe for API consistency with other intrinsics. - let c_out = unsafe { arch::_addcarry_u32(c_in, a, b, &mut sum) }; + let c_out = arch::_addcarry_u32(c_in, a, b, &mut sum); (c_out, sum) } fn sbb(b_in: u8, a: u32, b: u32) -> (u8, u32) { let mut sum = 0; - // SAFETY: There are no safety requirements for calling `_subborrow_u32`. - // It's just unsafe for API consistency with other intrinsics. - let b_out = unsafe { arch::_subborrow_u32(b_in, a, b, &mut sum) }; + let b_out = arch::_subborrow_u32(b_in, a, b, &mut sum); (b_out, sum) } @@ -52,17 +48,13 @@ mod x86_64 { fn adc(c_in: u8, a: u64, b: u64) -> (u8, u64) { let mut sum = 0; - // SAFETY: There are no safety requirements for calling `_addcarry_u64`. - // It's just unsafe for API consistency with other intrinsics. - let c_out = unsafe { arch::_addcarry_u64(c_in, a, b, &mut sum) }; + let c_out = arch::_addcarry_u64(c_in, a, b, &mut sum); (c_out, sum) } fn sbb(b_in: u8, a: u64, b: u64) -> (u8, u64) { let mut sum = 0; - // SAFETY: There are no safety requirements for calling `_subborrow_u64`. - // It's just unsafe for API consistency with other intrinsics. - let b_out = unsafe { arch::_subborrow_u64(b_in, a, b, &mut sum) }; + let b_out = arch::_subborrow_u64(b_in, a, b, &mut sum); (b_out, sum) }