How to get assembly output from building with Cargo?
You can use Cargo’s cargo rustc command to send arguments to rustc directly: cargo rustc — –emit asm ls target/debug/deps/<crate_name>-<hash>.s For optimized assembly: cargo rustc –release — –emit asm ls target/release/deps/<crate_name>-<hash>.s If you see multiple <crate_name>-<hash>-<hash>.rcgu.s files instead of a <crate_name>-<hash>.s file, disable incremental compilation by setting the environment variable CARGO_INCREMENTAL=0.