Crate features / proc-macro2
Feature flags · proc-macro2 1.0.107 · from crates.io 2026-10-24
proc-macro2 features: what each one does, and the line to copy
Short answerproc-macro2 1.0.107 has 3 features. By default it turns on proc-macro; add default-features = false to start from nothing. It needs Rust 1.71 or newer.
Pick features
Every feature
| Feature | In default | Turns on |
|---|---|---|
nightly | nothing else (a switch the code checks) | |
proc-macro | yes | nothing else (a switch the code checks) |
span-locations | nothing else (a switch the code checks) |
dep:x turns on the optional dependency x; x/y turns on feature y of dependency x (with ?, only if x is already on).
MSRV history
The minimum Rust version proc-macro2 declares (rust-version), and the release that changed it:
- 1.0.30 (2021-10-12): Rust 1.31
- 1.0.66 (2023-07-16): Rust 1.56
- 1.0.102 (2025-10-22): Rust 1.60
- 1.0.104 (2025-12-27): Rust 1.68
- 1.0.107 (2026-07-19): Rust 1.71
Stuck on an older compiler? Pin the last version that supports it, for example cargo update -p proc-macro2 --precise <version>, or use resolver 3, which picks compatible versions for you.
More on proc-macro2
Real downloads, dependents and alternatives: proc-macro2 crate data (4.9M real downloads a day, 16,351 dependents).
docs.rs feature list · crates.io · license MIT OR Apache-2.0 · edition 2021
Up next
Before you depend on itproc-macro2 crate dataReal downloads, dependents, alternatives.Read it next →Did this answer your question?