diff options
Diffstat (limited to 'library/coretests/tests')
| -rw-r--r-- | library/coretests/tests/mem.rs | 2 | ||||
| -rw-r--r-- | library/coretests/tests/num/flt2dec/mod.rs | 2 | ||||
| -rw-r--r-- | library/coretests/tests/ptr.rs | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/library/coretests/tests/mem.rs b/library/coretests/tests/mem.rs index 1b5c5fc82a6..9cb94ca3b0f 100644 --- a/library/coretests/tests/mem.rs +++ b/library/coretests/tests/mem.rs @@ -648,7 +648,7 @@ fn offset_of_dst() { z: dyn Trait, } - extern "C" { + unsafe extern "C" { type Extern; } diff --git a/library/coretests/tests/num/flt2dec/mod.rs b/library/coretests/tests/num/flt2dec/mod.rs index 3d825224813..6041923117c 100644 --- a/library/coretests/tests/num/flt2dec/mod.rs +++ b/library/coretests/tests/num/flt2dec/mod.rs @@ -80,7 +80,7 @@ fn ldexp_f32(a: f32, b: i32) -> f32 { } fn ldexp_f64(a: f64, b: i32) -> f64 { - extern "C" { + unsafe extern "C" { fn ldexp(x: f64, n: i32) -> f64; } // SAFETY: assuming a correct `ldexp` has been supplied, the given arguments cannot possibly diff --git a/library/coretests/tests/ptr.rs b/library/coretests/tests/ptr.rs index 345bec345d1..0c9f9b338b0 100644 --- a/library/coretests/tests/ptr.rs +++ b/library/coretests/tests/ptr.rs @@ -97,7 +97,7 @@ fn test_is_null() { let nmi: *mut dyn ToString = null_mut::<isize>(); assert!(nmi.is_null()); - extern "C" { + unsafe extern "C" { type Extern; } let ec: *const Extern = null::<Extern>(); @@ -308,7 +308,7 @@ fn test_const_nonnull_new() { pub fn test_variadic_fnptr() { use core::ffi; use core::hash::{Hash, SipHasher}; - extern "C" { + unsafe extern "C" { // This needs to use the correct function signature even though it isn't called as some // codegen backends make it UB to declare a function with multiple conflicting signatures // (like LLVM) while others straight up return an error (like Cranelift). @@ -506,7 +506,7 @@ fn offset_from() { fn ptr_metadata() { struct Unit; struct Pair<A, B: ?Sized>(A, B); - extern "C" { + unsafe extern "C" { type Extern; } let () = metadata(&()); |
