rust-lang / rust-lang/rust-bindgen
Feature request: use C2Rust to generate Rust versions of static inline functions
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
As described in #1090, bindgen is currently unable to expose static inline functions defined in C header files. This is because this functions do not actually exist anywhere in the linked library, but rather only in the header file itself. The proposed solution described in the other issue requires modifying the actual generated library on the C side which isn't always possible.
C2Rust is a new tool that can directly produce Rust code from C source, which would enable bindgen to actually produce Rust versions of these static inline functions. As a result, the Rust bindings would be able call these functions while still linking to unmodified versions of the original C library.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing issue #1090 and the C2Rust tool description linked here, then trace how bindgen handles static inline functions in C headers. Done means producing Rust versions of those functions while allowing the bindings to link against an unmodified C library; no specific files or tests are identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, rust
- Domain
- compilers, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100