rust-bindgen
rust-bindgen copied to clipboard
derive/impl fail inconsistently for blocked uint32_t/etc
Input C/C++ Header
typedef int uint32_t;
struct foo {
uint32_t a;
};
Bindgen Invocation
bindgen::Builder::default()
.header("test.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.allowlist_type("foo")
.allowlist_recursively(false)
.generate()
.expect("bindgen failure").write_to_file("test.rs").unwrap();
Actual Results
No derive impl generated. With .impl_debug(true)
, the field is not printed.
Expected Results
Derive impl generated (since the struct is correctly generated, and even without allowlist_recursively(false)
the struct definition doesn't use the type
definition instead of u32
).
The particularly odd part is that this succeeds without the parse_callbacks
. In 0.58.1 this failed regardless. Workaround is to just generate twice, and throw out the one with the parse callbacks.