1.44.0 #
- Released on: 4 June, 2020
- Branched from master on: 17 April, 2020
Language #
Syntax-only changes
#[cfg(FALSE)]
mod foo {
mod bar {
mod baz; // `foo/bar/baz.rs` doesn't exist, but no error!
}
}These are still rejected semantically, so you will likely receive an error but these changes can be seen and parsed by macros and conditional compilation.
Compiler #
- Rustc now respects the
-C codegen-unitsflag in incremental mode. Additionally when in incremental mode rustc defaults to 256 codegen units. - Refactored
catch_unwindto have zero-cost, unless unwinding is enabled and a panic is thrown. - Added tier 3* support for the
aarch64-unknown-noneandaarch64-unknown-none-softfloattargets. - Added tier 3 support for
arm64-apple-tvosandx86_64-apple-tvostargets.
Libraries #
- Special cased
vec![]to map directly toVec::new(). This allowsvec![]to be able to be used inconstcontexts. convert::Infalliblenow implementsHash.OsStringnow implementsDerefMutandIndexMutreturning a&mut OsStr.- Unicode 13 is now supported.
Stringnow implementsFrom<&mut str>.IoSlicenow implementsCopy.Vec<T>now implementsFrom<[T; N]>. WhereNis at most 32.proc_macro::LexErrornow implementsfmt::DisplayandError.from_le_bytes,to_le_bytes,from_be_bytes,to_be_bytes,from_ne_bytes, andto_ne_bytesmethods are nowconstfor all integer types.
Stabilized APIs #
PathBuf::with_capacityPathBuf::capacityPathBuf::clearPathBuf::reservePathBuf::reserve_exactPathBuf::shrink_to_fitf32::to_int_uncheckedf64::to_int_uncheckedLayout::align_toLayout::pad_to_alignLayout::arrayLayout::extend
Cargo #
- Added the
cargo treecommand which will print a tree graph of your dependencies. E.g.
You can also display dependencies on multiple versions of the same crate withmdbook v0.3.2 (/Users/src/rust/mdbook) ├── ammonia v3.0.0 │ ├── html5ever v0.24.0 │ │ ├── log v0.4.8 │ │ │ └── cfg-if v0.1.9 │ │ ├── mac v0.1.1 │ │ └── markup5ever v0.9.0 │ │ ├── log v0.4.8 (*) │ │ ├── phf v0.7.24 │ │ │ └── phf_shared v0.7.24 │ │ │ ├── siphasher v0.2.3 │ │ │ └── unicase v1.4.2 │ │ │ [build-dependencies] │ │ │ └── version_check v0.1.5 ...cargo tree -d(short forcargo tree --duplicates).
Misc #
Compatibility Notes #
- Rustc now correctly generates static libraries on Windows GNU targets with
the
.aextension, rather than the previous.lib. - Removed the
-C no_integrated_asflag from rustc. - The
file_nameproperty in JSON output of macro errors now points the actual source file rather than the previous format of<NAME macros>. Note: this may not point to a file that actually exists on the user’s system. - The minimum required external LLVM version has been bumped to LLVM 8.
mem::{zeroed, uninitialised}will now panic when used with types that do not allow zero initialization such asNonZeroU8. This was previously a warning.- In 1.45.0 (the next release) converting a
f64tou32using theasoperator has been defined as a saturating operation. This was previously undefined behaviour, but you can use the{f64, f32}::to_int_uncheckedmethods to continue using the current behaviour, which may be desirable in rare performance sensitive situations.
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.