Is there /FAsc in Rustc?

I'm learning about c with msvc cl, and using /FAsc to generate asm codes.

I know godbolt for generating asm, but i'm looking for the options for rustc to generate asm codes.

Thanks for your patience.

You can ask rustc to generate assembly using rustc --emit asm, which is useful for checking small self-contained files. For projer projects that use cargo, you'll want something like the cargo-show-asm sub-command (cargo install cargo-asm) which lets you do something like cargo asm lib_crate::bar::double_n to see the assembly for a particular function.

2 Likes

The cargo-asm package is abandoned, you should install cargo-show-asm instead. It's still the cargo asm command.

2 Likes