about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2025-02-12 14:59:57 -0800
committerEric Huss <eric@huss.org>2025-03-11 09:46:35 -0700
commitb130747e92c92c6cf3a1abb1ac71825eba6b18e3 (patch)
treeaa9381d93a95d58edc80dfa5aa86d118c96ba2be
parentba06ce611439cfe4beead76b650e8c0b0bf538b1 (diff)
downloadrust-b130747e92c92c6cf3a1abb1ac71825eba6b18e3.tar.gz
rust-b130747e92c92c6cf3a1abb1ac71825eba6b18e3.zip
Migrate windows-targets to Rust 2024
-rw-r--r--library/windows_targets/Cargo.toml2
-rw-r--r--library/windows_targets/src/lib.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/library/windows_targets/Cargo.toml b/library/windows_targets/Cargo.toml
index 94d7c821064..705c9e04381 100644
--- a/library/windows_targets/Cargo.toml
+++ b/library/windows_targets/Cargo.toml
@@ -2,7 +2,7 @@
 name = "windows-targets"
 description = "A drop-in replacement for the real windows-targets crate for use in std only."
 version = "0.0.0"
-edition = "2021"
+edition = "2024"
 
 [features]
 # Enable using raw-dylib for Windows imports.
diff --git a/library/windows_targets/src/lib.rs b/library/windows_targets/src/lib.rs
index 939fab7d5fe..c7d158584eb 100644
--- a/library/windows_targets/src/lib.rs
+++ b/library/windows_targets/src/lib.rs
@@ -12,7 +12,7 @@ pub macro link {
     ($library:literal $abi:literal $($link_name:literal)? $(#[$doc:meta])? fn $($function:tt)*) => (
         #[cfg_attr(not(target_arch = "x86"), link(name = $library, kind = "raw-dylib", modifiers = "+verbatim"))]
         #[cfg_attr(target_arch = "x86", link(name = $library, kind = "raw-dylib", modifiers = "+verbatim", import_name_type = "undecorated"))]
-        extern $abi {
+        unsafe extern $abi {
             $(#[link_name=$link_name])?
             pub fn $($function)*;
         }
@@ -26,7 +26,7 @@ pub macro link {
         // libraries below by using an empty extern block. This works because extern blocks are not
         // connected to the library given in the #[link] attribute.
         #[link(name = "kernel32")]
-        extern $abi {
+        unsafe extern $abi {
             $(#[link_name=$link_name])?
             pub fn $($function)*;
         }