Closed Boddlnagg closed 7 years ago
Nightly (0.12) has MIR turned on by default now and doesn’t add a drop flag to the type any more; hopefully there won’t be any major issues, and it’ll all stay with MIR enabled and no drop flags added when we get to 0.12 being released as stable.
I reckon only supporting nightly for the next few months is perfectly reasonable.
Thanks for your comment, @chris-morgan! However, the current nightly still has the embedded drop flag even if it's not used (https://is.gd/VsLXeK). I think this is because https://github.com/rust-lang/rust/issues/34398 is not yet resolved.
I agree that the way to go is to just wait until this is done and then require nightly until it hits stable.
https://github.com/rust-lang/rust/pull/35764 will finally remove the drop flags.
:tada: https://github.com/rust-lang/rust/pull/35764 was merged! So we just need to wait for the next nightlies.
This now works correctly on recent nightlies, #23 adds tests for it which fail in the presence of dropflags.
Both
HString
andComPtr<T>
should be pointer sized, since they are wrapping a pointer, but actually are bigger because of drop flags. This is a problem for arrays/slices, because an array ofHSTRING
s should be transmutable to an array ofHString
s, and the same forComPtr
(element-wise conversion would be too expensive). This is why we currently expose raw types for arrays.One possibility is
#[unsafe_no_drop_flag]
, but this would not work on stable. Waiting for https://github.com/rust-lang/rust/issues/34398 should also resolve the issue.