Skip to content

[0.71.1]: Invalid generated method names. #3207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Kangie opened this issue May 14, 2025 · 0 comments
Open

[0.71.1]: Invalid generated method names. #3207

Kangie opened this issue May 14, 2025 · 0 comments

Comments

@Kangie
Copy link

Kangie commented May 14, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant