mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 07:04:04 -05:00
Make default Rust code compatible with 2024 edition (#7581)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user