dtolnay / syn

Parser for Rust source code
Apache License 2.0
2.82k stars 308 forks source link

Parse raw lifetimes #1729

Open compiler-errors opened 1 week ago

compiler-errors commented 1 week ago

In https://github.com/rust-lang/rust/pull/126452, T-lang decided that we should treat 'r#lifetime as "raw lifetime" syntax and reserve 'prefix#lifetime, (retroactively) beginning in edition 2021 as an extension of the work around reserving identifier prefixes in Rust's RFC 3101.

This is mostly motivated by wanting to give users a way to move off of 'gen lifetimes since gen is a reserved keyword in edition 2024, and we don't allow keyword lifetimes in Rust.

Syn should probably handle this too.