From ae21fbbffc4e51a26e27119484fd9a158bdb18cb Mon Sep 17 00:00:00 2001 From: narpfel Date: Sun, 20 Apr 2025 06:52:25 +0200 Subject: [PATCH] Make default Rust code compatible with 2024 edition (#7581) --- examples/rust/default.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/rust/default.rs b/examples/rust/default.rs index 65233495f..acf928648 100644 --- a/examples/rust/default.rs +++ b/examples/rust/default.rs @@ -3,10 +3,10 @@ // As of Rust 1.75, small functions are automatically // marked as `#[inline]` so they will not show up in // the output when compiling with optimisations. Use -// `#[no_mangle]` or `#[inline(never)]` to work around -// this issue. +// `#[unsafe(no_mangle)]` or `#[inline(never)]` to +// work around this issue. // See https://github.com/compiler-explorer/compiler-explorer/issues/5939 -#[no_mangle] +#[unsafe(no_mangle)] pub fn square(num: i32) -> i32 { num * num }