1.53.0
版本发布时间: 2021-06-17 22:43:07
rust-lang/rust最新发布版本:1.83.0(2024-11-28 22:02:00)
Language
-
You can now use unicode for identifiers. This allows multilingual identifiers but still doesn't allow glyphs that are not considered characters such as
◆
or🦀
. More specifically you can now use any identifier that matches the UAX #31 "Unicode Identifier and Pattern Syntax" standard. This is the same standard as languages like Python, however Rust uses NFC normalization which may be different from other languages. -
You can now specify "or patterns" inside pattern matches. Previously you could only use
|
(OR) on complete patterns. E.g.let x = Some(2u8); // Before matches!(x, Some(1) | Some(2)); // Now matches!(x, Some(1 | 2));
-
Added the
:pat_param
macro_rules!
matcher. This matcher has the same semantics as the:pat
matcher. This is to allow:pat
to change semantics to being a pattern fragment in a future edition.
Compiler
- Updated the minimum external LLVM version to LLVM 10.
-
Added Tier 3* support for the
wasm64-unknown-unknown
target. - Improved debuginfo for closures and async functions on Windows MSVC.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
-
Abort messages will now forward to
android_set_abort_message
on Android platforms when available. -
slice::IterMut<'_, T>
now implementsAsRef<[T]>
-
Arrays of any length now implement
IntoIterator
. Currently calling.into_iter()
as a method on an array will returnimpl Iterator<Item=&T>
, but this may change in a future edition to changeItem
toT
. CallingIntoIterator::into_iter
directly on arrays will provideimpl Iterator<Item=T>
as expected. -
leading_zeros
, andtrailing_zeros
are now available on allNonZero
integer types. -
{f32, f64}::from_str
now parse and print special values (NaN
,-0
) according to IEEE 754. -
You can now index into slices using
(Bound<usize>, Bound<usize>)
. -
Add the
BITS
associated constant to all numeric types.
Stabilised APIs
-
AtomicBool::fetch_update
-
AtomicPtr::fetch_update
-
BTreeMap::retain
-
BTreeSet::retain
-
BufReader::seek_relative
-
DebugStruct::non_exhaustive
-
Duration::MAX
-
Duration::ZERO
-
Duration::is_zero
-
Duration::saturating_add
-
Duration::saturating_mul
-
Duration::saturating_sub
-
ErrorKind::Unsupported
-
Option::insert
-
Ordering::is_eq
-
Ordering::is_ge
-
Ordering::is_gt
-
Ordering::is_le
-
Ordering::is_lt
-
Ordering::is_ne
-
OsStr::is_ascii
-
OsStr::make_ascii_lowercase
-
OsStr::make_ascii_uppercase
-
OsStr::to_ascii_lowercase
-
OsStr::to_ascii_uppercase
-
Peekable::peek_mut
-
Rc::decrement_strong_count
-
Rc::increment_strong_count
-
Vec::extend_from_within
-
array::from_mut
-
array::from_ref
-
cmp::max_by_key
-
cmp::max_by
-
cmp::min_by_key
-
cmp::min_by
-
f32::is_subnormal
-
f64::is_subnormal
Cargo
-
Cargo now supports git repositories where the default
HEAD
branch is not "master". This also includes a switch to the version 3Cargo.lock
format which can handle default branches correctly. -
macOS targets now default to
unpacked
split-debuginfo. -
The
authors
field is no longer included inCargo.toml
for new projects.
Rustdoc
Compatibility Notes
- Implement token-based handling of attributes during expansion
-
Ipv4::from_str
will now reject octal format IP addresses in addition to rejecting hexadecimal IP addresses. The octal format can lead to confusion and potential security vulnerabilities and is no longer recommended. -
The added
BITS
constant may conflict with external definitions. In particular, this was known to be a problem in thelexical-core
crate, but they have published fixes for semantic versions 0.4 through 0.7. To update this dependency alone, usecargo update -p lexical-core
. - Incremental compilation remains off by default, unless one uses the
RUSTC_FORCE_INCREMENTAL=1
environment variable added in 1.52.1.
Internal Only
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.