Skip to content

Deny keyword lifetimes pre-expansion #1708

@dtolnay

Description

@dtolnay

As of nightly-2024-07-18, rustc has begin rejecting code such as the following, which used to parse successfully. rust-lang/rust#126762

#[cfg(any())]
fn f<'ref>() {}
error: lifetimes cannot use keyword names
 --> src/main.rs:2:6
  |
2 | fn f<'ref>() {}
  |      ^^^^

If this is no longer valid Rust syntax, syn should reject it too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions