From 890bdfc331a0f0ebcfcf6a235ae49d75f481f9eb Mon Sep 17 00:00:00 2001 From: Cody Wyatt Neiman Date: Sun, 29 Dec 2024 17:03:12 -0500 Subject: [PATCH] fix: unsafe no_mangle attributes soon require unsafe() --- multivers-runner/src/lib.rs | 2 +- tests/test-nothing/src/main.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/multivers-runner/src/lib.rs b/multivers-runner/src/lib.rs index 95843e0..3e7e15b 100644 --- a/multivers-runner/src/lib.rs +++ b/multivers-runner/src/lib.rs @@ -26,7 +26,7 @@ use build::{Build, Executable}; /// - `argc` must never be negative. /// - `argv` and `envp` must be null-terminated arrays of valid pointers to null-terminated strings. /// - Each element of `argv` and `envp` must be valid for reads of bytes up to and including the null terminator. -#[no_mangle] +#[unsafe(no_mangle)] #[cfg(not(test))] pub unsafe extern "C" fn main(argc: i32, argv: *const *const i8, envp: *const *const i8) { let result = unsafe { run(argc, argv, envp) }; diff --git a/tests/test-nothing/src/main.rs b/tests/test-nothing/src/main.rs index ac0b7dc..0835f2e 100644 --- a/tests/test-nothing/src/main.rs +++ b/tests/test-nothing/src/main.rs @@ -3,17 +3,17 @@ #![cfg_attr(windows, windows_subsystem = "console")] #[used] -#[no_mangle] +#[unsafe(no_mangle)] pub static _fltused: i32 = 0; #[cfg(windows)] -#[no_mangle] +#[unsafe(no_mangle)] pub unsafe extern "C" fn mainCRTStartup() -> ! { windows_sys::Win32::System::Threading::ExitProcess(0); } #[cfg(target_os = "linux")] -#[no_mangle] +#[unsafe(no_mangle)] pub unsafe extern "C" fn _start() { let _ = syscalls::syscall!(syscalls::Sysno::exit, 0); }