rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

Automatically generates Rust FFI bindings to C (and some C++) libraries.

Results 460 rust-bindgen issues
Sort by recently updated
recently updated
newest added

Since [Rust 1.82](https://blog.rust-lang.org/2024/10/17/Rust-1.82.0.html#safe-items-with-unsafe-extern), `extern` items can be marked as safe. This PR adds the ability to mark functions and statics in the generated bindings as `safe` via `ParseCallbacks`. To fit...

Noticed immediately after #3317 was merged: Dynamic dispatch is not (always) needed here, and this way an owned `File` can trivially be moved into the function again like before without...

Fix #923. Fix #3200. This is due to a fallout from how `libclang` type would be processed with this patch. This patch introduce a new generator flag `--macro-const-use-ctypes`, which resolves...

Hi, I'm not really familiar with rust, but since a couple of months I have this bindgen error when compiling the rust-libxml crate: ``` error[E0080]: evaluation of constant value failed...

I went to Beyond Linux From Scratch and Compiled Bindgen, then I ran the testsuite, and it fails. [bindgentesterror.txt](https://github.com/user-attachments/files/23512076/bindgentesterror.txt)

Using some proprietary headers I can't really change that are full of bitfields, one of the structs has two bitfields, basically `x` and `set_x`. This triggers a compile error when...

This PR fixes #3320 : - Makes sure at least one header is provided : file or content - Add a test case A better approach would be to qualify...

*Context* : During compile time, I was facing a panic with generic error message for the code below ```rust println!("cargo:rerun-if-changed=src/xyz.h"); bindgen::Builder::default() .layout_tests(false) .allowlist_function("xyz_.*") .generate() .expect("Unable to generate bindings") .write_to_file("src/xyz.rs") .expect("Couldn't...

I have a generated struct ```rust #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct AVIndexEntry { // ...fields pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit, // ...more fields } ```...

Like `allowlist_item` and `blocklist_item` options, add new methods to `ParseCallbacks`, `ParseCallbacks::allow_item()` and `ParseCallbacks::block_item()`, to be able to allow and block items from being generated. `allowlist_*` and `blocklist_*` options work with...