-
Notifications
You must be signed in to change notification settings - Fork 303
1.38 release post #405
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
1.38 release post #405
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
posts/2019-09-26-Rust-1.38.0.md
Outdated
|
||
### Linting some incorrect uses of `mem::{uninitialized, zeroed}` | ||
|
||
As [previously announced](https://blog.rust-lang.org/2019/07/04/Rust-1.36.0.html#maybeuninitt%3E-instead-of-mem::uninitialized), `std::mem::uninitialized` is hard to use soundly. Instead, `MaybeUninit<T>` should be used. |
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.
The 1.36 announcement says that it is "essentially impossible" to use soundly. But it's not unsound to use to initialize plain-old-data (in the C++ sense), is it? If that's correct, then "hard to use soundly" seems reasonable; if not, then maybe we should go back to using stronger language.
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.
I'd be fine with "essentially impossible" as well -- I tweaked this because it sounded 100% certain but there are cases where it is OK... for example: mem::uninitialized::<MaybeUninit<u8>>()
. ;)
Actually, let's change back to "essentially impossible".
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.
As [previously announced](https://blog.rust-lang.org/2019/07/04/Rust-1.36.0.html#maybeuninitt%3E-instead-of-mem::uninitialized), `std::mem::uninitialized` is hard to use soundly. Instead, `MaybeUninit<T>` should be used. | |
As [previously announced](https://blog.rust-lang.org/2019/07/04/Rust-1.36.0.html#maybeuninitt%3E-instead-of-mem::uninitialized), `std::mem::uninitialized` is essentially impossible to use safely. Instead, `MaybeUninit<T>` should be used. |
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.
Pending the "essentially impossible" verbiage change
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.
(+ verbiage change)
7931db4
to
38216cb
Compare
This should be ready for the release, and will be merged in ~2 hours. |
cc @rust-lang/release @rust-lang/core