You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As plain u8, it's not possible to implement methods or traits on it, and it's awkward to use for any function signatures.
It will also generate type std_string = [u64; 3]; for std::string, but I haven't got a simple repro for that yet. It should generate struct std_string { _blob: [u64; 3], }.
The text was updated successfully, but these errors were encountered:
So this is in particular about typedefs of template specializations, given std::string is a typedef to std::basic_string<char>.
We handle typedefs of types we don't know the layout of replacing them with a blob if we happen to know the size of the specialization (I'm actually surprised that templated<int> generates a u8, that's definitely a bug).
Perhaps we should make those generate at least a struct wrapping the blob, that seems doable.
Yeah, there's something more complex about std::string though that these examples don't capture. Maybe related to inheritance? I need to set up creduce again.
Input C/C++ Header
Bindgen Invokation
Actual Results
Expected Results
The type for
simple
is fine.The type for
templated
is also OK, but this would be better:The type for
int_tmpl
is bad - it should be one of:type int_tmpl = templated<i32>
struct int_tmpl { _bindgen_opaque_blob: templated<i32>, }
struct int_tmpl;
As plain
u8
, it's not possible to implement methods or traits on it, and it's awkward to use for any function signatures.It will also generate
type std_string = [u64; 3];
forstd::string
, but I haven't got a simple repro for that yet. It should generatestruct std_string { _blob: [u64; 3], }
.The text was updated successfully, but these errors were encountered: