Version 1.52.1 (2021-05-10)
This release disables incremental compilation, unless the user has explicitly opted in via the newly added RUSTC_FORCE_INCREMENTAL=1 environment variable.
This is due to the widespread, and frequently occurring, breakage encountered by Rust users due to newly enabled incremental verification in 1.52.0. Notably, Rust users should upgrade to 1.52.0 or 1.52.1: the bugs that are detected by newly added incremental verification are still present in past stable versions, and are not yet fixed on any channel. These bugs can lead to miscompilation of Rust binaries.
These problems only affect incremental builds, so release builds with Cargo should not be affected unless the user has explicitly opted into incremental. Debug and check builds are affected.
See 84970 for more details.
Version 1.52.0 (2021-05-06)
Language
- Added the
unsafe_op_in_unsafe_fn
lint, which checks whether the unsafe code in anunsafe fn
is wrapped in aunsafe
block. This lint is allowed by default, and may become a warning or hard error in a future edition. - You can now cast mutable references to arrays to a pointer of the same type as the element.
Compiler
Added tier 3* support for the following targets.
s390x-unknown-linux-musl
riscv32gc-unknown-linux-musl
&riscv64gc-unknown-linux-musl
powerpc-unknown-openbsd
* Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
OsString
now implementsExtend
andFromIterator
.cmp::Reverse
now has#[repr(transparent)]
representation.Arc<impl Error>
now implementserror::Error
.- All integer division and remainder operations are now
const
.
Stabilised APIs
Arguments::as_str
char::MAX
char::REPLACEMENT_CHARACTER
char::UNICODE_VERSION
char::decode_utf16
char::from_digit
char::from_u32_unchecked
char::from_u32
slice::partition_point
str::rsplit_once
str::split_once
The following previously stable APIs are now const
.
char::len_utf8
char::len_utf16
char::to_ascii_uppercase
char::to_ascii_lowercase
char::eq_ignore_ascii_case
u8::to_ascii_uppercase
u8::to_ascii_lowercase
u8::eq_ignore_ascii_case
Rustdoc
- Rustdoc lints are now treated as a tool lint, meaning that
lints are now prefixed with
rustdoc::
(e.g.#[warn(rustdoc::broken_intra_doc_links)]
). Using the old style is still allowed, and will become a warning in a future release. - Rustdoc now supports argument files.
- Rustdoc now generates smart punctuation for documentation.
- You can now use "task lists" in Rustdoc Markdown. E.g.
- [x] Complete - [ ] Todo
Misc
- You can now pass multiple filters to tests. E.g.
cargo test -- foo bar
will run all tests that matchfoo
andbar
. - Rustup now distributes PDB symbols for the
std
library on Windows, allowing you to seestd
symbols when debugging.
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.
- Check the result cache before the DepGraph when ensuring queries
- Try fast_reject::simplify_type in coherence before doing full check
- Only store a LocalDefId in some HIR nodes
- Store HIR attributes in a side table
Compatibility Notes
- Cargo build scripts are now forbidden from setting
RUSTC_BOOTSTRAP
. - Removed support for the
x86_64-rumprun-netbsd
target. - Deprecated the
x86_64-sun-solaris
target in favor ofx86_64-pc-solaris
. - Rustdoc now only accepts
,
,\t
as delimiters for specifying languages in code blocks. - Rustc now catches more cases of
pub_use_of_private_extern_crate
- Changes in how proc macros handle whitespace may lead to panics when used
with older
proc-macro-hack
versions. Acargo update
should be sufficient to fix this in all cases. - Turn
#[derive]
into a regular macro attribute