Registry / other / proc-macro2

proc-macro2

JSON →
library1.0.106rscratesunverified

A substitute implementation of the compiler's proc_macro API to decouple token-based libraries from the procedural macro use case.

# Cargo.toml [dependencies] proc-macro2 = "1.0.106"
INSTALL
IMPORT
SIG · PROC-MACRO2
P
proc-macro2
otherrustv1.0.106
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TokenStream
use proc_macro2::TokenStream;

Parse a string into a TokenStream.

use proc_macro2::TokenStream; fn main() { let stream: TokenStream = "fn answer() -> u32 { 42 }".parse().unwrap(); println!("{}", stream); }
Debug
Known issues
gotchaproc-macro2 types are not directly compatible with proc_macro types; conversion may be needed.
fix
Use From/Into traits or the proc_macro2::TokenStream::from() method to convert.
affects: >=1.0.0
Upgrade
Version history
1.0.106latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
Bingbot
18
node
6
Amazon
1
Resources
proc-macro2 — cargo add proc-macro2 · libregistry