Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Static Analysis & Code Quality
  3. cargo-show-asm

cargo-show-asm

Apache-2.0Rust

A cargo subcommand to display assembly, LLVM-IR, MIR, and WASM generated for Rust code.

GitHubGitHub
974 stars50 forks0 contributors

What is cargo-show-asm?

cargo-show-asm is a Cargo subcommand that displays the low-level code generated by the Rust compiler, including assembly, LLVM-IR, MIR, and WebAssembly. It helps developers understand how their Rust code translates to machine code, enabling performance optimization and debugging of compilation behavior. The tool addresses the need for visibility into compiler output without the overhead of manual inspection.

Target Audience

Rust developers working on performance-critical applications, compiler enthusiasts, and those needing to debug or optimize generated code. It's particularly useful for systems programmers, embedded developers, and anyone investigating compiler behavior or WebAssembly output.

Value Proposition

Developers choose cargo-show-asm because it provides accurate, fast analysis without forcing recompilation, supports multiple output formats and architectures, and offers clean, customizable output. It's a maintained alternative to cargo-asm with better performance and more features.

Overview

cargo subcommand showing the assembly, LLVM-IR and MIR generated for Rust code

Use Cases

Best For

  • Optimizing Rust code by inspecting generated assembly
  • Debugging compiler behavior and understanding optimizations
  • Analyzing WebAssembly output for Rust projects
  • Learning how Rust code translates to low-level representations
  • Comparing different compiler flags or target architectures
  • Investigating inlining decisions and function call chains

Not Ideal For

  • Windows-based development environments requiring robust cross-platform tool support
  • Teams preferring graphical or IDE-integrated tools over command-line utilities for code analysis
  • Projects where minimizing build time is critical and extra compilation or analysis steps are unwanted
  • Developers focused solely on high-level application logic without need for assembly or compiler internals debugging

Pros & Cons

Pros

Accurate Build Configuration

Respects the user's actual build settings and avoids unnecessary recompilation, ensuring output matches the real compilation process as stated in the philosophy section.

Multi-Format Output

Supports assembly (Intel or AT&T syntax), LLVM-IR, MIR, WASM, and llvm-mca analysis, providing comprehensive insights into different compilation stages from the README features list.

Source Code Correlation

Can display Rust source code alongside generated assembly with the '--rust' flag, making it easier to debug and understand the mapping between high-level and low-level code.

Flexible Targeting Options

Allows analysis of specific functions, crates, binaries, examples, tests, or benchmarks with configurable context depth for call chains, as detailed in the usage examples.

Cons

Limited Windows Support

The README explicitly states 'Limited support for Windows', which can hinder developers on that platform and may lead to compatibility issues or missing features.

Complex Command-Line Interface

With numerous options and flags for postprocessing, targeting, and output formats, the tool can be overwhelming for users not familiar with compiler internals or detailed CLI usage.

Unstable MIR Formatting

MIR output relies on rustc's human-readable format, which the README notes is not stable and may change between compiler versions, affecting reliability for long-term projects.

Frequently Asked Questions

Quick Stats

Stars974
Forks50
Contributors0
Open Issues26
Last commit11 days ago
CreatedSince 2022

Tags

#compiler#webassembly#assembly#cargo-subcommand#llvm-ir#performance-analysis#low-level#cargo#cargo-plugin#optimization#rust#debugging#mir

Built With

R
Rust

Included in

Static Analysis & Code Quality14.5k
Auto-fetched 1 day ago

Related Projects

PHP ParserPHP Parser

A PHP parser written in PHP

Stars17,454
Forks1,133
Last commit1 month ago
TypeScript ESLintTypeScript ESLint

:sparkles: Monorepo for all the tooling which enables ESLint to support TypeScript

Stars16,366
Forks2,976
Last commit1 day ago
pyrightpyright

Static Type Checker for Python

Stars15,596
Forks1,804
Last commit1 day ago
ReviewdogReviewdog

🐶 Automated code review tool integrated with any code analysis tools regardless of programming language

Stars9,542
Forks490
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub