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.
← 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] - [
rustdochas 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 itTo 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=valoption.][47521] - [Added
i586-unknown-linux-musltarget][47282]
Libraries
- [Impl Send for
process::Commandon Unix.][47760] - [Impl PartialEq and Eq for
ParseCharError.][47790] - [
UnsafeCell::into_inneris 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
WriteforCursor<&mut Vec<u8>>][46830] - [Moved
Durationto 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 newno longer removesrustorrsprefixes/suffixes.][cargo/5013] - [
cargo newnow 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
- Deprecated
net::lookup_host. rustdochas switched to pulldown as the default markdown renderer.- The borrow checker was sometimes incorrectly permitting overlapping borrows around indexing operations (see #47349). This has been fixed (which also enabled some correct code that used to cause errors (e.g. #33903 and #46095).
- [Removed deprecated unstable attribute
#[simd].]47251
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.26Released May 10, 2018.Read it next →Also worth your time
Did this answer your question?