Rust versions / 1.55
Rust release · Sep 9, 2021
Rust 1.55: what's new, what was stabilized
Short answerRust 1.55 was released on Sep 9, 2021: 18 newly stable APIs (Bound::cloned, Drain::as_str, IntoInnerError::into_error, IntoInnerError::into_parts, ...); 4 compatibility notes that can affect existing code.
← Rust 1.54All versionsRust 1.56 →
18 APIs stabilized
Bound::cloned, Drain::as_str, IntoInnerError::into_error, IntoInnerError::into_parts, MaybeUninit::assume_init_mut, MaybeUninit::assume_init_ref, MaybeUninit::write, array::map, ops::ControlFlow, x86::_bittest, x86::_bittestandcomplement, x86::_bittestandreset, x86::_bittestandset, x86_64::_bittest64, x86_64::_bittestandcomplement64, x86_64::_bittestandreset64, x86_64::_bittestandset64, str::from_utf8_unchecked
Can it break my build?
The release lists these compatibility notes. Most only affect rare code, but read them before you raise your toolchain in CI:
- [std functions that return an
io::Errorwill no longer use the - [Using environment variable names with
process::Commandon Windows now - [Rustdoc will now warn on using rustdoc lints that aren't prefixed
RUSTFLAGSis no longer set for build scripts. Build scripts
Use it
rustup update stable # get the newest release
rustup install 1.55 # or exactly this one
rustup override set 1.55 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.55" under [package] in Cargo.toml. Cargo then refuses to build it on older compilers with a clear message, and with resolver 3 (the default on the 2024 edition, Rust 1.85+) it also prefers dependency versions that support it.
Full release notes
Language
- [You can now write open "from" range patterns (
X..), which will start atXand will end at the maximum value of the integer.][83918] - [You can now explicitly import the prelude of different editions through
std::prelude(e.g.use std::prelude::rust_2021::*;).][86294]
Compiler
- [Added tier 3\* support for
powerpc64le-unknown-freebsd.][83572]
\* Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
- [Updated std's float parsing to use the Eisel-Lemire algorithm.][86761] These improvements should in general provide faster string parsing of floats, no longer reject certain valid floating point values, and reduce the produced code size for non-stripped artifacts.
- [
string::Drainnow implementsAsRef<str>andAsRef<[u8]>.][86858]
Stabilized APIs
- [
Bound::cloned] - [
Drain::as_str] - [
IntoInnerError::into_error] - [
IntoInnerError::into_parts] - [
MaybeUninit::assume_init_mut] - [
MaybeUninit::assume_init_ref] - [
MaybeUninit::write] - [
array::map] - [
ops::ControlFlow] - [
x86::_bittest] - [
x86::_bittestandcomplement] - [
x86::_bittestandreset] - [
x86::_bittestandset] - [
x86_64::_bittest64] - [
x86_64::_bittestandcomplement64] - [
x86_64::_bittestandreset64] - [
x86_64::_bittestandset64]
The following previously stable functions are now const.
- [
str::from_utf8_unchecked]
Cargo
- [Cargo will now deduplicate compiler diagnostics to the terminal when invoking rustc in parallel such as when using
cargo test.][cargo/9675] - [The package definition in
cargo metadatanow includes the"default_run"field from the manifest.][cargo/9550] - [Added
cargo das an alias forcargo doc.][cargo/9680] - [Added
{lib}as formatting option forcargo treeto print the"lib_name"of packages.][cargo/9663]
Rustdoc
- [Added "Go to item on exact match" search option.][85876]
- [The "Implementors" section on traits no longer shows redundant method definitions.][85970]
- [Trait implementations are toggled open by default.][86260] This should make the implementations more searchable by tools like
CTRL+Fin your browser. - [Intra-doc links should now correctly resolve associated items (e.g. methods) through type aliases.][86334]
- [Traits which are marked with
#[doc(hidden)]will no longer appear in the "Trait Implementations" section.][86513]
Compatibility Notes
- std functions that return an
io::Errorwill no longer use theErrorKind::Othervariant. This is to better reflect that these kinds of errors could be categorised into newer more specificErrorKindvariants, and that they do not represent a user error. - Using environment variable names with
process::Commandon Windows now behaves as expected. Previously using environment variables withCommandwould cause them to be ASCII-uppercased. - Rustdoc will now warn on using rustdoc lints that aren't prefixed with
rustdoc:: RUSTFLAGSis no longer set for build scripts. Build scripts should useCARGO_ENCODED_RUSTFLAGSinstead. See the documentation for more details.
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.56Released Oct 21, 2021.Read it next →Also worth your time
Did this answer your question?