-
Notifications
You must be signed in to change notification settings - Fork 511
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
Address new nightly unsafe precondition check panics #2841
Conversation
Thank you for looking into this. It seems there's still one more failure:
Which indirectly points to windows-rs/crates/libs/core/src/event.rs Lines 161 to 167 in 40f671b
But that looks totally fine on its own. The empty case is checked and I very strongly doubt the size exceeds So looking at windows-rs/crates/libs/core/src/event.rs Lines 205 to 216 in 40f671b
It uses HeapAlloc, which aligns to 16 (or 8 on 32-bit) but then it writes a header which, is essentially an Quick fix here would be to add an |
Thanks all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I'll probably publish an update to crates.io soon to avoid dependents having issues with nightly. |
But we should probably get the feature doc search feature integrated before then. Let me know if there's anything else top of mind. |
Passing size=0, ptr=0 into
std::slice::from_raw_parts
is undefined behavior and is no longer safe to rely upon. Also addresses an unaligned pointer used byEvent
.See also:
rust-lang/rust#120902
rust-lang/rust#120594