Open petr-tik opened 6 years ago
This won't help for functions marked #[inline]
or #[inline(always)]
. This won't also help for generics that are not monomorphized, nor for unused items (e.g. non-exported non-used functions), so I don't think this is worth the trouble.
The error message notes should be improved in the spirit of what is discussed in #23 to make it clear in which cases can the compiler actually emit machine code or llvm-ir for a function.
Problem description
Running cargo asm builds the binary with --release by default. The compiler is smart enough to optimise some functions away. Those functions then won't be found when running
cargo asm crate::function::was_optimised_away
Improvement suggestion
Building with opt-level=$OPT_LEVER might optimise some functions away. Consider changing opt-level=0 in Cargo.toml