Emilio Cobos Álvarez
Emilio Cobos Álvarez
Actually, this is going to need some rust compiler magic I believe, otherwise examples like this (that currently work) would stop working if we just inline the fields: ```cpp class...
It seems that the logic is a bit more complicated, and clang only packs bits on the _last_ base class. That is, this test case still fails: ```cpp class WordAligned...
TL;DR: I think the sensible way to do this is inlining the _last_, and only the last base class members inside a given struct. That's going to be slightly annoying...
Upon reflection, it has nothing to do with whether it'd be the last field or not, but with whether the class would be properly aligned if it was packed inside.
You can't just inline base members because you may get incorrectly padded fields, like in the test case I wrote above, so we need to, at least, figure out which...
https://bugzilla.mozilla.org/show_bug.cgi?id=1363375 seems to indicate that MSVC doesn't follow the same rule here, which makes it much more fun to fix \o/
The layout tests were intentionally switched to built-time tests, that's the: ``` const _: () = { ["Size of sip_message_event"][::std::mem::size_of::() - 64usize]; ["Alignment of sip_message_event"][::std::mem::align_of::() - 8usize]; ["Offset of field:...
This one is interesting, thanks for the report!
Yes, you need to implement `Drop` yourself, because it can cause unsoundness otherwise. For example, if bindgen would implement `Drop` by default, dropping `Outer` would end up calling `~Inner` twice,...
> You said that #1841 is the same as this issue and renamed this issue. But adding the default destructor/default constructor and calling the deconstructor using the drop trait are...