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_fnlint, which checks whether the unsafe code in anunsafe fnis wrapped in aunsafeblock. 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-muslriscv32gc-unknown-linux-musl&riscv64gc-unknown-linux-muslpowerpc-unknown-openbsd
* Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
OsStringnow implementsExtendandFromIterator.cmp::Reversenow has#[repr(transparent)]representation.Arc<impl Error>now implementserror::Error.- All integer division and remainder operations are now
const.
Stabilised APIs
Arguments::as_strchar::MAXchar::REPLACEMENT_CHARACTERchar::UNICODE_VERSIONchar::decode_utf16char::from_digitchar::from_u32_uncheckedchar::from_u32slice::partition_pointstr::rsplit_oncestr::split_once
The following previously stable APIs are now const.
char::len_utf8char::len_utf16char::to_ascii_uppercasechar::to_ascii_lowercasechar::eq_ignore_ascii_caseu8::to_ascii_uppercaseu8::to_ascii_lowercaseu8::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 barwill run all tests that matchfooandbar. - Rustup now distributes PDB symbols for the
stdlibrary on Windows, allowing you to seestdsymbols 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-netbsdtarget. - Deprecated the
x86_64-sun-solaristarget in favor ofx86_64-pc-solaris. - Rustdoc now only accepts
,,, and\tas 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-hackversions. Acargo updateshould be sufficient to fix this in all cases. - Turn
#[derive]into a regular macro attribute