Email me

Rust versions / 1.25

Rust release · Mar 29, 2018

Rust 1.25: what's new, what was stabilized

Short answerRust 1.25 was released on Mar 29, 2018: 5 newly stable APIs (Location::column, ptr::NonNull, Duration::new, Duration::from_secs, ...); 4 compatibility notes that can affect existing code.

Mar 29, 2018release date
0language stabilizations
5APIs stabilized
-new edition

← Rust 1.24All versionsRust 1.26 →

5 APIs stabilized

Location::column, ptr::NonNull, Duration::new, Duration::from_secs, Duration::from_millis

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:

  • [Deprecated net::lookup_host.][47510]
  • [rustdoc has switched to pulldown as the default markdown renderer.][47398]
  • The borrow checker was sometimes incorrectly permitting overlapping borrows
  • [Removed deprecated unstable attribute #[simd].][47251]

Use it

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

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

  • [The #[repr(align(x))] attribute is now stable.][47006] [RFC 1358]
  • [You can now use nested groups of imports.][47948] e.g. use std::{fs::File, io::Read, path::{Path, PathBuf}};
  • [You can now have | at the start of a match arm.][47947] e.g.
enum Foo { A, B, C }

fn main() {
    let x = Foo::A;
    match x {
        | Foo::A
        | Foo::B => println!("AB"),
        | Foo::C => println!("C"),
    }
}

Compiler

  • [Upgraded to LLVM 6.][47828]
  • [Added -C lto=val option.][47521]
  • [Added i586-unknown-linux-musl target][47282]

Libraries

  • [Impl Send for process::Command on Unix.][47760]
  • [Impl PartialEq and Eq for ParseCharError.][47790]
  • [UnsafeCell::into_inner is now safe.][47204]
  • [Implement libstd for CloudABI.][47268]
  • [Float::{from_bits, to_bits} is now available in libcore.][46931]
  • [Implement AsRef<Path> for Component][46985]
  • [Implemented Write for Cursor<&mut Vec<u8>>][46830]
  • [Moved Duration to libcore.][46666]

Stabilized APIs

  • [Location::column]
  • [ptr::NonNull]

The following functions can now be used in a constant expression. eg. static MINUTE: Duration = Duration::from_secs(60);

  • [Duration::new][47300]
  • [Duration::from_secs][47300]
  • [Duration::from_millis][47300]

Cargo

  • [cargo new no longer removes rust or rs prefixes/suffixes.][cargo/5013]
  • [cargo new now defaults to creating a binary crate, instead of a library crate.][cargo/5029]

Misc

  • [Rust by example is now shipped with new releases][46196]

Compatibility Notes

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

← Rust 1.24All versionsRust 1.26 →

Up next

Next releaseRust 1.26Released May 10, 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