Skip to content

[0.71.1]: Invalid generated method names. #3207

Open
@Kangie

Description

@Kangie

Unable to compile Mesa with 0.71.1 for Fedora in a Mesa CI container due to the following:

[3762/4770] Compiling Rust source src/etnaviv/isa/isa_bindings.rs
FAILED: src/etnaviv/isa/libisa_bindings.rlib 
rustc -C linker=cc --color=always -C debug-assertions=no -C overflow-checks=no --crate-type rlib -D warnings --edition=2021 -C opt-level=3 --crate-name isa_bindings --emit dep-info=src/etnaviv/isa/isa_bindings.d --emit link=src/etnaviv/isa/libisa_bindings.rlib --out-dir src/etnaviv/isa/libisa_bindings.rlib.p -C metadata=5824fa0@@isa_bindings@sta -Anon_camel_case_types src/etnaviv/isa/isa_bindings.rs
error: method `use__raw` should have a snake case name
 --> src/etnaviv/isa/isa_bindings.rs:1:9453
  |
1 | ...s u64) } } # [inline] pub unsafe fn use__raw (this : * const Self) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transm...
  |                                        ^^^^^^^^ help: convert the identifier to snake case: `use_raw`
  |
  = note: `-D non-snake-case` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(non_snake_case)]`
error: method `use__raw` should have a snake case name
 --> src/etnaviv/isa/isa_bindings.rs:1:29259
  |
1 | ...s u64) } } # [inline] pub unsafe fn use__raw (this : * const Self) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transm...
  |                                        ^^^^^^^^ help: convert the identifier to snake case: `use_raw`
error: aborting due to 2 previous errors

The field is called use on the C side, however as this is a reserved keyword bindgen is suffixing a _, but not dropping it when the function is named.

Encountered in the following Mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33725#note_2909634

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