1.52.0 #
- Released on: 6 May, 2021
- Branched from master on: 19 March, 2021
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