No matter what sort of Rust code you use, if you add the flags -C opt-level=2, then no assembly will be generated. It still works if you do -C opt-level=0, but not with anything else.
Hi @Slabity - are you making your function pub ? https://godbolt.org/g/hlWEAy shows you can view code with -C opt-level=2 if the function is public. If it's not public and it is unused, the llvm optimizer removes the function completely.
Looks like that was probably it. I didn't realize it was compiling as a library and used fn main() without pub.
Thanks for following up. Perhaps I need to make it clearer somehow what's going on!
Most helpful comment
Hi @Slabity - are you making your function
pub? https://godbolt.org/g/hlWEAy shows you can view code with-C opt-level=2if the function is public. If it's not public and it is unused, the llvm optimizer removes the function completely.