- Released on: 29 July, 2021
- Branched from master on: 11 June, 2021
You can now use macros for values in some built-in attributes. This primarily allows you to call macros within the
#[doc]attribute. For example, to include external documentation in your crate, you can now write the following:
#![doc = include_str!("README.md")]
You can now use multiple generic lifetimes with
impl Traitwhere the lifetimes don’t explicitly outlive another. In code this means that you can now have
impl Trait<'a, 'b>where as before you could only have
impl Trait<'a, 'b> where 'b: 'a.
- Rustc will now search for custom JSON targets in
/is the “sysroot” directory. You can find your sysroot directory by running
rustc --print sysroot.
target_familyfor WebAssembly platforms.
- You can now use
#[target_feature]on safe functions when targeting WebAssembly platforms.
- Improved debugger output for enums on Windows MSVC platforms.
- Added tier 3* support for
-Zmutable-noalias=yesis enabled by default when using LLVM 12 or above.
* Refer to Rust’s [platform support page][platform-support-doc] for more information on Rust’s tiered platform support.
OutOfMemoryas a variant of
- The implementations of vendor intrinsics in core::arch have been significantly refactored. The main user-visible changes are a 50% reduction in the size of libcore.rlib and stricter validation of constant operands passed to intrinsics. The latter is technically a breaking change, but allows Rust to more closely match the C vendor intrinsics API.
Stabilized APIs #
- Added the
--prune <spec>option to
cargo-treeto remove a package from the dependency graph.
- Added the
cargo-treeto print only to a certain depth in the tree
- Added the
cargo-tree --edgesto hide procedural macro dependencies.
- A new environment variable named
CARGO_TARGET_TMPDIRis available. This variable points to a directory that integration tests and benches can use as a “scratchpad” for testing filesystem operations.
Compatibility Notes #
- Mixing Option and Result via
?is no longer permitted in closures for inferred types.
- Previously unsound code is no longer permitted where different constructors in branches could require different lifetimes.
- As previously mentioned the
std::archintrinsics now uses stricter const checking than before and may reject some previously accepted code.
i128multiplication on Cortex M0+ platforms currently unconditionally causes overflow when compiled with
codegen-units = 1.