Email me

Rust versions / 1.22

Rust release · Nov 22, 2017

Rust 1.22: what's new, what was stabilized

Short answerRust 1.22 was released on Nov 22, 2017: 2 compatibility notes that can affect existing code. Point release: 1.22.1 (Nov 22, 2017).

Nov 22, 2017release date
0language stabilizations
0APIs stabilized
-new edition

← Rust 1.21All versionsRust 1.23 →

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:

  • [The minimum Android version that rustc can build for has been bumped
  • [Allowing T op= &T for numeric types has broken some type

Use it

rustup update stable        # get the newest release
rustup install 1.22          # or exactly this one
rustup override set 1.22     # pin a project to it

To require at least this version from users of your crate, set rust-version = "1.22" 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

  • [non_snake_case lint now allows extern no-mangle functions][44966]
  • [Now accepts underscores in unicode escapes][43716]
  • [T op= &T now works for numeric types.][44287] eg. let mut x = 2; x += &8;
  • [types that impl Drop are now allowed in const and static types][44456]

Compiler

  • [rustc now defaults to having 16 codegen units at debug on supported platforms.][45064]
  • [rustc will no longer inline in codegen units when compiling for debug][45075] This should decrease compile times for debug builds.
  • [strict memory alignment now enabled on ARMv6][45094]
  • [Remove support for the PNaCl target le32-unknown-nacl][45041]

Libraries

  • [Allow atomic operations up to 32 bits on armv5te_unknown_linux_gnueabi][44978]
  • [Box<Error> now impls From<Cow<str>>][44466]
  • [std::mem::Discriminant is now guaranteed to be Send + Sync][45095]
  • [fs::copy now returns the length of the main stream on NTFS.][44895]
  • [Properly detect overflow in Instant += Duration.][44220]
  • [impl Hasher for {&mut Hasher, Box<Hasher>}][44015]
  • [impl fmt::Debug for SplitWhitespace.][44303]
  • [Option<T> now impls Try][42526] This allows for using ? with Option types.

Cargo

  • [Cargo will now build multi file examples in subdirectories of the examples folder that have a main.rs file.][cargo/4496]
  • [Changed [root] to [package] in Cargo.lock][cargo/4571] Packages with the old format will continue to work and can be updated with cargo update.
  • [Now supports vendoring git repositories][cargo/3992]

Misc

  • [libbacktrace is now available on Apple platforms.][44251]
  • [Stabilised the compile_fail attribute for code fences in doc-comments.][43949] This now lets you specify that a given code example will fail to compile.

Compatibility Notes

1.22.1 (Nov 22, 2017)

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

← Rust 1.21All versionsRust 1.23 →

Up next

Next releaseRust 1.23Released Jan 4, 2018.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