Skip to content

Instantly share code, notes, and snippets.

@niklasad1
Created February 11, 2019 10:15
Show Gist options
  • Save niklasad1/b838695ef436a0a16d5cd80cf462905f to your computer and use it in GitHub Desktop.
Save niklasad1/b838695ef436a0a16d5cd80cf462905f to your computer and use it in GitHub Desktop.
Rust, cargo commands

Expand macros

$ cargo rustc -- --pretty expanded -Z unstable-options

Emit asm

$ cargo rustc -- --emit asm && cat target/debug/deps/project_name-hash.s

Emit llvm-ir

$ cargo rustc -- --emit llvm-ir && cat target/debug/deps/project_name-hash.ll

Emit HIR

$ cargo rustc -- -Zunpretty=hir

Emit MIR

$ cargo rustc -- -Zunpretty=mir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment