Email me

Rust versions / 1.37

Rust release · Aug 15, 2019

Rust 1.37: what's new, what was stabilized

Short answerRust 1.37 was released on Aug 15, 2019: 20 newly stable APIs (BufReader::buffer, BufWriter::buffer, Cell::from_mut, Cell<[T]>::as_slice_of_cells, ...); 2 compatibility notes that can affect existing code.

Aug 15, 2019release date
0language stabilizations
20APIs stabilized
-new edition

← Rust 1.36All versionsRust 1.38 →

20 APIs stabilized

BufReader::buffer, BufWriter::buffer, Cell::from_mut, Cell<[T]>::as_slice_of_cells, DoubleEndedIterator::nth_back, Option::xor, Wrapping::reverse_bits, i128::reverse_bits, i16::reverse_bits, i32::reverse_bits, i64::reverse_bits, i8::reverse_bits, isize::reverse_bits, slice::copy_within, u128::reverse_bits, u16::reverse_bits, u32::reverse_bits, u64::reverse_bits, u8::reverse_bits, usize::reverse_bits

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:

  • [Using ... for inclusive range patterns will now warn by default.][61342]
  • [Using a trait object without the dyn will now warn by default.][61203]

Use it

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

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

  • #[must_use] will now warn if the type is contained in a [tuple][61100], [Box][62228], or an [array][62235] and unused.
  • [You can now use the cfg and cfg_attr attributes on generic parameters.][61547]
  • [You can now use enum variants through type alias.][61682] e.g. You can write the following: ```rust type MyOption = Option<u8>;

fn increment_or_zero(x: MyOption) -> u8 { match x { MyOption::Some(y) => y + 1, MyOption::None => 0, } } ```

  • [You can now use _ as an identifier for consts.][61347] e.g. You can write const _: u32 = 5;.
  • [You can now use #[repr(align(X)] on enums.][61229]
  • [The ? Kleene macro operator is now available in the 2015 edition.][60932]

Compiler

  • [You can now enable Profile-Guided Optimization with the -C profile-generate and -C profile-use flags.][61268] For more information on how to use profile guided optimization, please refer to the [rustc book][rustc-book-pgo].
  • [The rust-lldb wrapper script should now work again.][61827]

Libraries

  • [mem::MaybeUninit<T> is now ABI-compatible with T.][61802]

Stabilized APIs

  • [BufReader::buffer]
  • [BufWriter::buffer]
  • [Cell::from_mut]
  • [Cell<[T]>::as_slice_of_cells][Cell<slice>::as_slice_of_cells]
  • [DoubleEndedIterator::nth_back]
  • [Option::xor]
  • [Wrapping::reverse_bits]
  • [i128::reverse_bits]
  • [i16::reverse_bits]
  • [i32::reverse_bits]
  • [i64::reverse_bits]
  • [i8::reverse_bits]
  • [isize::reverse_bits]
  • [slice::copy_within]
  • [u128::reverse_bits]
  • [u16::reverse_bits]
  • [u32::reverse_bits]
  • [u64::reverse_bits]
  • [u8::reverse_bits]
  • [usize::reverse_bits]

Cargo

  • [Cargo.lock files are now included by default when publishing executable crates with executables.][cargo/7026]
  • [You can now specify default-run="foo" in [package] to specify the default executable to use for cargo run.][cargo/7056]

Compatibility Notes

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

← Rust 1.36All versionsRust 1.38 →

Up next

Next releaseRust 1.38Released Sep 26, 2019.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