Make default Rust code compatible with 2024 edition (#7581)

This commit is contained in:
narpfel
2025-04-20 06:52:25 +02:00
committed by GitHub
parent 8f08dae192
commit ae21fbbffc

View File

@@ -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
}