proc-macro2 icon indicating copy to clipboard operation
proc-macro2 copied to clipboard

Results 25 proc-macro2 issues
Sort by recently updated
recently updated
newest added

Right now, it looks like `proc_macro2::Span::unwrap` is the only way to get a `proc_macro::Span`, but that will panic if it's called outside a proc macro. Could there be a `TryFrom`/`TryInto`...

I couldn't easily figure by myself reading the code and documentation of `proc-macro` and `proc-macro2`, so asking here. Is it possible to generate a `Span` that points to its own...

In my [custom-format crate](https://github.com/x-hgg-x/custom-format/blob/bdc31a66d7940c3c4ed5680271f86fca1c70cde9/src/lib.rs#L44), I pass the special `$crate` identifier from a declarative macro to a procedural macro, which allows me to avoid using a crate such as [proc-macro-crate](https://crates.io/crates/proc-macro-crate). This...

As of #335, `TokenStream` is `Rc`. This makes twice as many allocations as it should, because there's one that holds {strong count, weak count, data ptr, length, capacity} and a...

The documentation for `Ident` has an example of how to make an ident with a name derived from another: https://docs.rs/proc-macro2/1.0.32/proc_macro2/struct.Ident.html#examples by just interpolating with `format!()`. However, it appears that if...

docs

It would be good to have some extra information in the documentation about how to handle `r#`-prefixed identifiers. For example: > Special care should be taken when using Rust reserved...

docs

Attempting to parse doc comments I find myself in need of various adjustments so the string representation and the actual span length are equiv as well as extracting a span...

[rustc_lexer](https://crates.io/crates/rustc_lexer) `rustc_lexer` is now [the lexer used by rustc and is on crates for reuse](https://github.com/rust-lang/rust/pull/59706). rust-analyzer is already using it. It would make sense for `proc-macro2` to also use `rustc_lexer`...

The compiler's proc_macro::Span uses an efficient encoding in 4 bytes. Currently our span when procmacro2_semver_exempt is enabled is a whopping 12 bytes because it essentially looks like: ```rust enum Span...

Hi there, thanks for the amazing work on this library. I am trying to experiment with processing multiple parsed file trees with syn using rayon, however `Span` is not Send...