Email me

Rust versions / 1.26

Rust release · May 10, 2018

Rust 1.26: what's new, what was stabilized

Short answerRust 1.26 was released on May 10, 2018: 40 newly stable APIs (*const T::add, *const T::copy_to_nonoverlapping, *const T::copy_to, *const T::read_unaligned, ...); 6 compatibility notes that can affect existing code. Point releases: 1.26.1 (May 29, 2018), 1.26.2 (Jun 5, 2018).

May 10, 2018release date
0language stabilizations
40APIs stabilized
-new edition

← Rust 1.25All versionsRust 1.27 →

40 APIs stabilized

*const T::add, *const T::copy_to_nonoverlapping, *const T::copy_to, *const T::read_unaligned, *const T::read_volatile, *const T::read, *const T::sub, *const T::wrapping_add, *const T::wrapping_sub, *mut T::add, *mut T::copy_to_nonoverlapping, *mut T::copy_to, *mut T::read_unaligned, *mut T::read_volatile, *mut T::read, *mut T::replace, *mut T::sub, *mut T::swap, *mut T::wrapping_add, *mut T::wrapping_sub, *mut T::write_bytes, *mut T::write_unaligned, *mut T::write_volatile, *mut T::write, Box::leak, FromUtf8Error::as_bytes, LocalKey::try_with, Option::cloned, btree_map::Entry::and_modify, fs::read_to_string, fs::read, fs::write, hash_map::Entry::and_modify, iter::FusedIterator, ops::RangeInclusive, ops::RangeToInclusive, process::id, slice::rotate_left, slice::rotate_right, String::retain

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:

  • [aliasing a Fn trait as dyn no longer works.][48481] E.g. the following
  • [The result of dereferences are no longer promoted to 'static.][47408]
  • [Deprecate AsciiExt trait in favor of inherent methods.][49109]
  • [".e0" will now no longer parse as 0.0 and will instead cause
  • [Removed hoedown from rustdoc.][48274]
  • [Bounds on higher-kinded lifetimes a hard error.][48326]

Use it

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

To require at least this version from users of your crate, set rust-version = "1.26" 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 now implement Copy and/or Clone if all captured variables implement either or both traits.][49299]
  • [The inclusive range syntax e.g. for x in 0..=10 is now stable.][47813]
  • [The '_ lifetime is now stable. The underscore lifetime can be used anywhere a lifetime can be elided.][49458]
  • [impl Trait is now stable allowing you to have abstract types in returns or in function parameters.][49255] E.g. fn foo() -> impl Iterator<Item=u8> or fn open(path: impl AsRef<Path>).
  • [Pattern matching will now automatically apply dereferences.][49394]
  • [128-bit integers in the form of u128 and i128 are now stable.][49101]
  • [main can now return Result<(), E: Debug>][49162] in addition to ().
  • [A lot of operations are now available in a const context.][46882] E.g. You can now index into constant arrays, reference and dereference into constants, and use tuple struct constructors.
  • [Fixed entry slice patterns are now stable.][48516] E.g. ``rust let points = [1, 2, 3, 4]; match points { [1, 2, 3, 4] => println!("All points were sequential."), _ => println!("Not all points were sequential."), } ``

Compiler

  • [LLD is now used as the default linker for wasm32-unknown-unknown.][48125]
  • [Fixed exponential projection complexity on nested types.][48296] This can provide up to a ~12% reduction in compile times for certain crates.
  • [Added the --remap-path-prefix option to rustc.][48359] Allowing you to remap path prefixes outputted by the compiler.
  • [Added powerpc-unknown-netbsd target.][48281]

Libraries

  • [Implemented From<u16> for usize & From<{u8, i16}> for isize.][49305]
  • [Added hexadecimal formatting for integers with fmt::Debug][48978] e.g. assert!(format!("{:02x?}", b"Foo\0") == "[46, 6f, 6f, 00]")
  • [Implemented Default, Hash for cmp::Reverse.][48628]
  • [Optimized str::repeat being 8x faster in large cases.][48657]
  • [ascii::escape_default is now available in libcore.][48735]
  • [Trailing commas are now supported in std and core macros.][48056]
  • [Implemented Copy, Clone for cmp::Reverse][47379]
  • [Implemented Clone for char::{ToLowercase, ToUppercase}.][48629]

Stabilized APIs

  • [*const T::add]
  • [*const T::copy_to_nonoverlapping]
  • [*const T::copy_to]
  • [*const T::read_unaligned]
  • [*const T::read_volatile]
  • [*const T::read]
  • [*const T::sub]
  • [*const T::wrapping_add]
  • [*const T::wrapping_sub]
  • [*mut T::add]
  • [*mut T::copy_to_nonoverlapping]
  • [*mut T::copy_to]
  • [*mut T::read_unaligned]
  • [*mut T::read_volatile]
  • [*mut T::read]
  • [*mut T::replace]
  • [*mut T::sub]
  • [*mut T::swap]
  • [*mut T::wrapping_add]
  • [*mut T::wrapping_sub]
  • [*mut T::write_bytes]
  • [*mut T::write_unaligned]
  • [*mut T::write_volatile]
  • [*mut T::write]
  • [Box::leak]
  • [FromUtf8Error::as_bytes]
  • [LocalKey::try_with]
  • [Option::cloned]
  • [btree_map::Entry::and_modify]
  • [fs::read_to_string]
  • [fs::read]
  • [fs::write]
  • [hash_map::Entry::and_modify]
  • [iter::FusedIterator]
  • [ops::RangeInclusive]
  • [ops::RangeToInclusive]
  • [process::id]
  • [slice::rotate_left]
  • [slice::rotate_right]
  • [String::retain]

Cargo

  • [Cargo will now output path to custom commands when -v is passed with --list][cargo/5041]
  • [The Cargo binary version is now the same as the Rust version][cargo/5083]

Misc

  • [The second edition of "The Rust Programming Language" book is now recommended over the first.][48404]

Compatibility Notes

1.26.1 (May 29, 2018)

Tools -----

Compatibility Notes --------

1.26.2 (Jun 5, 2018)

Compatibility Notes -------------------

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

← Rust 1.25All versionsRust 1.27 →

Up next

Next releaseRust 1.27Released Jun 21, 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