We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
struct test { unsigned int type; float a; union { int b; int c; }; };
$ bindgen --no-rustfmt-bindings --with-derive-default --impl-debug -o tests.rs headers/test.h
The translation of struct is correct:
#[repr(C)] #[derive(Copy, Clone)] pub struct perf_event_attr { pub type_: ::std::os::raw::c_uint, pub a: f32, pub __bindgen_anon_1: perf_event_attr__bindgen_ty_1, }
But the impl Debug is wrong
impl ::std::fmt::Debug for perf_event_attr { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { write ! ( f , "perf_event_attr {{ type: {:?}, a: {:?}, __bindgen_anon_1: {:?} }}" , self . type , self . a , self . __bindgen_anon_1 ) } }
error: expected identifier, found keyword `type` --> tests.rs:100:100 | 100 | write ! ( f , "perf_event_attr {{ type: {:?}, a: {:?}, __bindgen_anon_1: {:?} }}" , self . type , self . a , self . __bindgen_anon_1 ) | ^^^^ error: aborting due to previous error
Should be type_ not type.
The text was updated successfully, but these errors were encountered:
@highfive assign me
Sorry, something went wrong.
Hey @photoszzt! Thanks for your interest in working on this issue. It's now assigned to you!
Auto merge of #1123 - photoszzt:fix_mangle_name, r=pepyakin
8d045d2
Need mangle name of fields in struct for impl debug Fix #1122 r? @fitzgen or @emilio or @pepyakin
No branches or pull requests
Input C/C++ Header
Bindgen Invocation
Actual Results
The translation of struct is correct:
But the impl Debug is wrong
Expected Results
Should be type_ not type.
The text was updated successfully, but these errors were encountered: