Skip to content

Rust 1.36 release tweaks #395

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

Merged
merged 1 commit into from
Jul 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions posts/2019-07-04-Rust-1.36.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ but required a global allocator and other OS capabilities in return.

Starting with Rust 1.36.0, the parts of `std` that depend on a global allocator, e.g. `Vec<T>`,
are now available in the `alloc` crate. The `std` crate then re-exports these parts.
While `#![no_std]` binaries using `alloc` still require nightly Rust,
`#![no_std]` library crates can use the `alloc` crate in stable Rust.
While `#![no_std]` *binaries* using `alloc` still require nightly Rust,
`#![no_std]` *library* crates can use the `alloc` crate in stable Rust.
Meanwhile, normal binaries, without `#![no_std]`, can depend on such library crates.
We hope this will facilitate the development of a `#![no_std]` compatible ecosystem of libraries
prior to stabilizing support for `#![no_std]` binaries using `alloc`.
Expand Down Expand Up @@ -82,7 +82,7 @@ However, [`mem::uninitialized`] is an incredibly dangerous operation that essent
cannot be used correctly as the Rust compiler assumes that values are properly initialized.
For example, calling `mem::uninitialized::<bool>()` causes *instantaneous __undefined behavior__*
as, from Rust's point of view, the uninitialized bits are neither `0` (for `false`)
nor `1` (for `true`) -- the only two allowed bit patterns for `bool`.
nor `1` (for `true`) - the only two allowed bit patterns for `bool`.

To remedy this situation, in Rust 1.36.0, the type [`MaybeUninit<T>`] has been [stabilized][pr-60445].
The Rust compiler will understand that it should not assume that a [`MaybeUninit<T>`] is a properly initialized `T`.
Expand Down