Crate

proc-macro2

Stable TokenStream for use outside proc-macro context.

What it is

proc-macro2 provides a usable-outside-proc-macros version of Rust's proc_macro::TokenStream. It allows proc-macro helper libraries like syn and quote to be compiled, tested, and used in regular code rather than only inside procedural macros.

Why it is commonly used

An implementation detail of the syn/quote proc-macro ecosystem. Application code rarely depends on it directly — its high repo count comes from crates that ship proc-macros.

979
Repositories
89%
Actively maintained
864
Updated ≤ 30 days
3.6M
Total stars
819
Owners

Counted from the Cargo.toml manifests of the 979 indexed repositories that declare proc-macro2 as a dependency — not download counts. Dependency data last verified 2026-08-13.

Browse 979 repositories using proc-macro2 in Repos →
Often used with

Crates that show up unusually often in proc-macro2 projects. The most distinctive pairings rank first — crates these projects use far more than the average indexed Rust project does, not just crates that are popular everywhere. Each percentage is the share of proc-macro2 projects that also use it.

Used by these organizations
50 of 979 repositories · ranked by stars · 864 pushed in the last 30 days
bun95kactive

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one

⑂ 5.0k8.0k
union74kactive

The trust-minimized, zero-knowledge bridging protocol, designed for censorship resistance, extremely high security, and usage in decentralized finance.

hyperswitch43kactive

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

servo38kactive

Servo aims to empower developers with a lightweight, high-performance alternative for embedding web technologies in applications.

⑂ 3.7k3.1k
qdrant34kactive

Qdrant - High-performance, massive-scale Vector Database and Vector Search Engine for the next generation of AI. Also available in the cloud https://cloud.qdrant.io/

tokio33kactive

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...

⑂ 3.2k417
Graphite27kactive

Community-built comprehensive 2D content creation appplication for graphic design, digital art, and interactive real-time motion graphics powered by a node-based procedural graphics engine

Ciphey22kactive

⚡ Automatically decrypt encryptions without knowing the key or cipher, decode encodings, and crack hashes ⚡

← Browse all repos