Language
- You can now write open "from" range patterns (
X..
), which will start atX
and 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::Drain
now 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 metadata
now includes the"default_run"
field from the manifest. - Added
cargo d
as an alias forcargo doc
. - Added
{lib}
as formatting option forcargo tree
to 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+F
in 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::Error
will no longer use theErrorKind::Other
variant. This is to better reflect that these kinds of errors could be categorised into newer more specificErrorKind
variants, and that they do not represent a user error. - Using environment variable names with
process::Command
on Windows now behaves as expected. Previously using envionment variables withCommand
would cause them to be ASCII-uppercased. - Rustdoc will now warn on using rustdoc lints that aren't prefixed with
rustdoc::
RUSTFLAGS
is no longer set for build scripts. Build scripts should useCARGO_ENCODED_RUSTFLAGS
instead. See the documentation for more details.