rust-lang / rust-lang/rust-bindgen

bindgen + llvm-19 optimize out some needed const

Open
#2,956 1 comment 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

#define DRM_RS_IOCTL(FOO) \
   static const unsigned long DRM_RS_IOCTL_##FOO = DRM_IOCTL_##FOO

DRM_RS_IOCTL(NOUVEAU_EXEC);

becomes nak_bindings.rs.txt

and code fails later with

error[E0425]: cannot find value `DRM_RS_IOCTL_NOUVEAU_EXEC` in this scope

Original bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12008

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 with the DRM_RS_IOCTL macro and the attached nak_bindings.rs.txt output, then reproduce the bindgen + llvm-19 generation described in the issue. Done means DRM_RS_IOCTL_NOUVEAU_EXEC remains available in the generated Rust bindings so the later code compiles; compare findings with the linked Mesa issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, rust
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.