Update Sep 9, 2021 tracked by Updatify
Rust 1.55.0
Language
-
You can now write open “from” range patterns (
X..), which will start atXand will end at the maximum value of the integer. -
You can now explicitly import the prelude of different editions through
std::prelude(e.g.use std::prelude::rust_2021::*;).
Compiler
* Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
Libraries
- Updated std’s float parsing to use the Eisel-Lemire algorithm. 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]>.
Stabilised 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.
Cargo
-
Cargo will now deduplicate compiler diagnostics to the terminal when invoking rustc in parallel such as when using
cargo test. -
The package definition in
cargo metadatanow includes the"default_run"field from the manifest. -
Added
cargo das an alias forcargo doc. -
Added
{lib}as formatting option forcargo treeto print the"lib_name"of packages.
Rustdoc
- Added “Go to item on exact match” search option.
- The “Implementors” section on traits no longer shows redundant method definitions.
-
Trait implementations are toggled open by default. 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.
-
Traits which are marked with
#[doc(hidden)]will no longer appear in the “Trait Implementations” section.
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.