Rust versions / 1.47
Rust release · Oct 8, 2020
Rust 1.47: what's new, what was stabilized
Short answerRust 1.47 was released on Oct 8, 2020: 13 newly stable APIs (Ident::new_raw, Range::is_empty, RangeInclusive::is_empty, Result::as_deref, ...); 6 compatibility notes that can affect existing code.
← Rust 1.46All versionsRust 1.48 →
13 APIs stabilized
Ident::new_raw, Range::is_empty, RangeInclusive::is_empty, Result::as_deref, Result::as_deref_mut, Vec::leak, pointer::offset_from, f32::TAU, f64::TAU, new, checked_add, checked_abs, is_ascii_alphabetic
Can it break my build?
The release lists these compatibility notes. Most only affect rare code, but read them before you raise your toolchain in CI:
- [Bumped the minimum supported Emscripten version to 1.39.20.][75716]
- [Fixed a regression parsing
{} && falsein tail expressions.][74650] - [Added changes to how proc-macros are expanded in
macro_rules!that should - [Moved support for the CloudABI target to tier 3.][75568]
- [
linux-gnutargets now require minimum kernel 2.6.32 and glibc 2.11.][74163] - [Added the
rustc-docscomponent.][75560] This allows you to install
Use it
rustup update stable # get the newest release
rustup install 1.47 # or exactly this one
rustup override set 1.47 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.47" under [package] in Cargo.toml. Cargo then refuses to build it on older compilers with a clear message, and with resolver 3 (the default on the 2024 edition, Rust 1.85+) it also prefers dependency versions that support it.
Full release notes
Language
- [Closures will now warn when not used.][74869]
Compiler
- [Stabilized the
-C control-flow-guardcodegen option][73893], which enables [Control Flow Guard][1.47.0-cfg] for Windows platforms, and is ignored on other platforms. - [Upgraded to LLVM 11.][73526]
- [Added tier 3\* support for the
thumbv4t-none-eabitarget.][74419] - [Upgrade the FreeBSD toolchain to version 11.4][75204]
- [
RUST_BACKTRACE's output is now more compact.][75048]
\* Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
- [
CStrnow implementsIndex<RangeFrom<usize>>.][74021] - [Traits in
std/coreare now implemented for arrays of any length, not just those of length less than 33.][74060] - [
ops::RangeFullandops::Rangenow implement Default.][73197] - [
panic::Locationnow implementsCopy,Clone,Eq,Hash,Ord,PartialEq, andPartialOrd.][73583]
Stabilized APIs
- [
Ident::new_raw] - [
Range::is_empty] - [
RangeInclusive::is_empty] - [
Result::as_deref] - [
Result::as_deref_mut] - [
Vec::leak] - [
pointer::offset_from] - [
f32::TAU] - [
f64::TAU]
The following previously stable APIs have now been made const.
- [The
newmethod for allNonZerointegers.][73858] - [The
checked_add,checked_sub,checked_mul,checked_neg,checked_shl,checked_shr,saturating_add,saturating_sub, andsaturating_mulmethods for all integers.][73858] - [The
checked_abs,saturating_abs,saturating_neg, andsignumfor all signed integers.][73858] - [The
is_ascii_alphabetic,is_ascii_uppercase,is_ascii_lowercase,is_ascii_alphanumeric,is_ascii_digit,is_ascii_hexdigit,is_ascii_punctuation,is_ascii_graphic,is_ascii_whitespace, andis_ascii_controlmethods forcharandu8.][73858]
Cargo
- [
build-dependenciesare now built with opt-level 0 by default.][cargo/8500] You can override this by setting the following in yourCargo.toml. ``toml [profile.release.build-override] opt-level = 3`` - [
cargo-helpwill now display man pages for commands rather just the--helptext.][cargo/8456] - [
cargo-metadatanow emits atestfield indicating if a target has tests enabled.][cargo/8478] - [
workspace.default-membersnow respectsworkspace.exclude.][cargo/8485] - [
cargo-publishwill now use an alternative registry by default if it's the only registry specified inpackage.publish.][cargo/8571]
Misc
- [Added a help button beside Rustdoc's searchbar that explains rustdoc's type based search.][75366]
- [Added the Ayu theme to rustdoc.][71237]
Compatibility Notes
- [Bumped the minimum supported Emscripten version to 1.39.20.][75716]
- [Fixed a regression parsing
{} && falsein tail expressions.][74650] - [Added changes to how proc-macros are expanded in
macro_rules!that should help to preserve more span information.][73084] These changes may cause compilation errors if your macro was unhygenic or didn't correctly handleDelimiter::None. - [Moved support for the CloudABI target to tier 3.][75568]
- [
linux-gnutargets now require minimum kernel 2.6.32 and glibc 2.11.][74163] - [Added the
rustc-docscomponent.][75560] This allows you to install and read the documentation for the compiler internal APIs. (Currently only available forx86_64-unknown-linux-gnu.)
Internal Only
- Improved default settings for bootstrapping in
x.py. You can read details about this change in the "Changes tox.pydefaults" post on the Inside Rust blog.
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.48Released Nov 19, 2020.Read it next →Also worth your time
Did this answer your question?