rust-lang / rust-lang/rust-bindgen

[BUG] Invalid binding generation for union with long double field

Open
#3,381 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.3k
Forks
829
Avg merge
1d 1h
Merged PRs (30d)
15

Description

I hit this issue due to a transitive dependency on bindgen 0.70 being bumped to 0.71 (and later 0.72.1):

  • #2159

I don't really know what changed in recent versions that could lead to this, but I first got the transitive dependency bumped to 0.72.1 to get the fix for:

  • #3264

Which did not fix my mingw-w64 CI fail.

  • raylib in v5.5+ depends on bindgen 0.70 which did not surface the problem
  • raylib v6.0.0-rc.2 bumped bindgen to 0.71, which suffers from
    • #3264
    • I tried bumping to 0.72.1 to get the fix to #3264, but this problem did not go away
      Using opaque_type or blocklist_type fixed it.
x86_64-w64-mingw32-gcc --version
x86_64-w64-mingw32-gcc (GCC) 16.1.0

clang --version
clang version 22.1.5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the mingw-w64 CI failure with the reported bindgen, raylib, GCC, and Clang versions, then compare generated bindings across bindgen 0.70, 0.71, and 0.72.1. Done means the union containing a long double field generates valid bindings without requiring opaque_type or blocklist_type.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, rust
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.