-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
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
Get rid of drop flags in wrappers #12
Comments
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 rust-lang/rust#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. |
rust-lang/rust#35764 will finally remove the drop flags. |
🎉 rust-lang/rust#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 rust-lang/rust#34398 should also resolve the issue.The text was updated successfully, but these errors were encountered: