Email me

Rust versions / 1.21

Rust release · Oct 12, 2017

Rust 1.21: what's new, what was stabilized

Short answerRust 1.21 was released on Oct 12, 2017: 3 compatibility notes that can affect existing code.

Oct 12, 2017release date
0language stabilizations
0APIs stabilized
-new edition

← Rust 1.20All versionsRust 1.22 →

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:

  • [Changes in method matching against higher-ranked types][43880] This may cause
  • [rustc's JSON error output's byte position start at top of file.][42973]
  • [unused_results lint no longer ignores booleans][43728]

Use it

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

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

  • [You can now use static references for literals.][43838] Example: ``rust fn main() { let x: &'static u32 = &0; } ``
  • [Relaxed path syntax. Optional :: before < is now allowed in all contexts.][43540] Example: ``rust my_macro!(Vec<i32>::new); // Always worked my_macro!(Vec::<i32>::new); // Now works ``

Compiler

  • [Upgraded jemalloc to 4.5.0][43911]
  • [Enabled unwinding panics on Redox][43917]
  • [Now runs LLVM in parallel during translation phase.][43506] This should reduce peak memory usage.

Libraries

  • [Generate builtin impls for Clone for all arrays and tuples that are T: Clone][43690]
  • [Stdin, Stdout, and Stderr now implement AsRawFd.][43459]
  • [Rc and Arc now implement From<&[T]> where T: Clone, From<str>, From<String>, From<Box<T>> where T: ?Sized, and From<Vec<T>>.][42565]

Stabilized APIs

[std::mem::discriminant]

Cargo

  • [You can now call cargo install with multiple package names][cargo/4216]
  • [Cargo commands inside a virtual workspace will now implicitly pass --all][cargo/4335]
  • [Added a [patch] section to Cargo.toml to handle prepublication dependencies][cargo/4123] [RFC 1969]
  • [include & exclude fields in Cargo.toml now accept gitignore like patterns][cargo/4270]
  • [Added the --all-targets option][cargo/4400]
  • [Using required dependencies as a feature is now deprecated and emits a warning][cargo/4364]

Misc

  • [Cargo docs are moving][43916] to doc.rust-lang.org/cargo
  • [The rustdoc book is now available][43863] at doc.rust-lang.org/rustdoc
  • [Added a preview of RLS has been made available through rustup][44204] Install with rustup component add rls-preview
  • [std::os documentation for Unix, Linux, and Windows now appears on doc.rust-lang.org][43348] Previously only showed std::os::unix.

Compatibility Notes

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

← Rust 1.20All versionsRust 1.22 →

Up next

Next releaseRust 1.22Released Nov 22, 2017.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