Email me

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.

Oct 8, 2020release date
0language stabilizations
13APIs stabilized
-new edition

← 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 {} && false in 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-gnu targets now require minimum kernel 2.6.32 and glibc 2.11.][74163]
  • [Added the rustc-docs component.][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 it

To 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-guard codegen 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-eabi target.][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

  • [CStr now implements Index<RangeFrom<usize>>.][74021]
  • [Traits in std/core are now implemented for arrays of any length, not just those of length less than 33.][74060]
  • [ops::RangeFull and ops::Range now implement Default.][73197]
  • [panic::Location now implements Copy, Clone, Eq, Hash, Ord, PartialEq, and PartialOrd.][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 new method for all NonZero integers.][73858]
  • [The checked_add,checked_sub,checked_mul,checked_neg, checked_shl, checked_shr, saturating_add, saturating_sub, and saturating_mul methods for all integers.][73858]
  • [The checked_abs, saturating_abs, saturating_neg, and signum for 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, and is_ascii_control methods for char and u8.][73858]

Cargo

  • [build-dependencies are now built with opt-level 0 by default.][cargo/8500] You can override this by setting the following in your Cargo.toml. ``toml [profile.release.build-override] opt-level = 3 ``
  • [cargo-help will now display man pages for commands rather just the --help text.][cargo/8456]
  • [cargo-metadata now emits a test field indicating if a target has tests enabled.][cargo/8478]
  • [workspace.default-members now respects workspace.exclude.][cargo/8485]
  • [cargo-publish will now use an alternative registry by default if it's the only registry specified in package.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 {} && false in 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 handle Delimiter::None.
  • [Moved support for the CloudABI target to tier 3.][75568]
  • [linux-gnu targets now require minimum kernel 2.6.32 and glibc 2.11.][74163]
  • [Added the rustc-docs component.][75560] This allows you to install and read the documentation for the compiler internal APIs. (Currently only available for x86_64-unknown-linux-gnu.)

Internal Only

Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.

← Rust 1.46All versionsRust 1.48 →

Up next

Next releaseRust 1.48Released Nov 19, 2020.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ