From 64e9ca74a8ffaedcae2490fe5245ab8c941efe30 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 9 Feb 2025 09:12:30 -0800 Subject: Apply missing_unsafe_on_extern --- library/stdarch/crates/std_detect/src/detect/cache.rs | 2 +- library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'library/stdarch/crates/std_detect/src') diff --git a/library/stdarch/crates/std_detect/src/detect/cache.rs b/library/stdarch/crates/std_detect/src/detect/cache.rs index cee07b0ec7e..3056c28a806 100644 --- a/library/stdarch/crates/std_detect/src/detect/cache.rs +++ b/library/stdarch/crates/std_detect/src/detect/cache.rs @@ -140,7 +140,7 @@ cfg_if::cfg_if! { if #[cfg(windows)] { use alloc::vec; #[link(name = "kernel32")] - extern "system" { + unsafe extern "system" { fn GetEnvironmentVariableA(name: *const u8, buffer: *mut u8, size: u32) -> u32; } let len = unsafe { GetEnvironmentVariableA(RUST_STD_DETECT_UNSTABLE.as_ptr().cast::(), core::ptr::null_mut(), 0) }; diff --git a/library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs b/library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs index faded671cc0..ec31701aecf 100644 --- a/library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs +++ b/library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs @@ -20,7 +20,7 @@ pub(crate) fn detect_features() -> cache::Initializer { const PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE: u32 = 44; const PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE: u32 = 45; - extern "system" { + unsafe extern "system" { pub fn IsProcessorFeaturePresent(ProcessorFeature: DWORD) -> BOOL; } -- cgit 1.4.1-3-g733a5