Files
compiler-explorer/examples/rust/default.rs
T
narpfel 21aaec6be5 Add note to Rust example explaining why functions are missing in the output (#6013)
Resolves #5939.

Rust issue about this problem:
https://github.com/rust-lang/rust/issues/119850

Hopefully this can be reverted again when there is a fix on the Rust
side.
2024-01-16 22:02:20 -06:00

16 lines
506 B
Rust

// Type your code here, or load an example.
// 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.
// See https://github.com/compiler-explorer/compiler-explorer/issues/5939
#[no_mangle]
pub fn square(num: i32) -> i32 {
num * num
}
// If you use `main()`, declare it as `pub` to see it in the output:
// pub fn main() { ... }