Skip to content

Edition 2024: Identifiers named gen should be renamed to raw r#gen #3093

Closed
@liss-h

Description

@liss-h

Hi, I understand that edition 2024 is not stable yet, but I wanted to notify you in advance of its stabilization (which will be in the next stable rust release as far as I understood).

Currently, bindgen cannot generate correct bindings for edition 2024, because it does not take the new reserved gen keyword into consideration, i.e. it incorrectly does not generate a raw identifier (r#gen).

Versions

  • rustc 1.86.0-nightly (in edition 2024 mode)
  • bindgen 0.71.1 (library)

Example

C Function:

void f(int gen);

Generated:

unsafe extern "C" {
    pub fn f(gen: i32);
}

Expected:

unsafe extern "C" {
    pub fn f(r#gen: i32);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions