Skip to content

Commit

Permalink
Add note to Rust example explaining why functions are missing in the …
Browse files Browse the repository at this point in the history
…output (#6013)

Resolves #5939.

Rust issue about this problem:
rust-lang/rust#119850

Hopefully this can be reverted again when there is a fix on the Rust
side.
  • Loading branch information
narpfel committed Jan 17, 2024
1 parent dab53cb commit 21aaec6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/rust/default.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
// 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
}
Expand Down

0 comments on commit 21aaec6

Please sign in to comment.