I want to use https://rust.godbolt.org to see the assembly output of this function:
fn add(a: u8, b: u8) -> u8 {
a + b
}
Pasting this on the website works fine, but shows a lot of assembly. This is not unsurprising, given that rustc
compiles my code in debug mode by default. When I compile in release mode by passing -O
to the compiler, there is no output at all!
What am I doing wrong? Why does the Rust compiler remove everything in release mode?