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).
← 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= &Tfor 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 itTo 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_caselint now allows extern no-mangle functions][44966] - [Now accepts underscores in unicode escapes][43716]
- [
T op= &Tnow works for numeric types.][44287] eg.let mut x = 2; x += &8; - [types that impl
Dropare now allowed inconstandstatictypes][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 implsFrom<Cow<str>>][44466] - [
std::mem::Discriminantis now guaranteed to beSend + Sync][45095] - [
fs::copynow returns the length of the main stream on NTFS.][44895] - [Properly detect overflow in
Instant += Duration.][44220] - [impl
Hasherfor{&mut Hasher, Box<Hasher>}][44015] - [impl
fmt::DebugforSplitWhitespace.][44303] - [
Option<T>now implsTry][42526] This allows for using?withOptiontypes.
Cargo
- [Cargo will now build multi file examples in subdirectories of the
examplesfolder that have amain.rsfile.][cargo/4496] - [Changed
[root]to[package]inCargo.lock][cargo/4571] Packages with the old format will continue to work and can be updated withcargo update. - [Now supports vendoring git repositories][cargo/3992]
Misc
- [
libbacktraceis now available on Apple platforms.][44251] - [Stabilised the
compile_failattribute for code fences in doc-comments.][43949] This now lets you specify that a given code example will fail to compile.
Compatibility Notes
- The minimum Android version that rustc can build for has been bumped to
4.0from2.3 - Allowing
T op= &Tfor numeric types has broken some type inference cases
1.22.1 (Nov 22, 2017)
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.23Released Jan 4, 2018.Read it next →Also worth your time
Did this answer your question?