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
Reproduction:
/** * <div rustbindgen="true" replaces="std::string"> */ class CxxString { char* ptr; }; #include <string> #include <cstdint> typedef std::string my_string; struct A { my_string a; }; struct B { std::string a; };
Command:
cargo run -- test.hpp --no-layout-tests --allowlist-type A --allowlist-type B --enable-cxx-namespaces
Bindgen version 20aa65a (today's main).
main
Rust generated:
/* automatically generated by rust-bindgen 0.71.1 */ #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { #[allow(unused_imports)] use self::super::root; pub mod std { #[allow(unused_imports)] use self::super::super::root; #[doc = " <div rustbindgen=\"true\" replaces=\"std::string\">"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct string { pub ptr: *mut ::std::os::raw::c_char, } } pub type my_string = root::std::string; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct A { pub a: root::my_string, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct B { pub a: root::std::string, pub __bindgen_padding_0: [u64; 2usize], } }
Note that struct B contains padding, but struct A doesn't. This means the size of struct A is wrong.
struct B
struct A
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Reproduction:
Command:
Bindgen version 20aa65a (today's
main
).Rust generated:
Note that
struct B
contains padding, butstruct A
doesn't. This means the size ofstruct A
is wrong.The text was updated successfully, but these errors were encountered: