Rust versions / 1.24
Rust release · Feb 15, 2018
Rust 1.24: what's new, what was stabilized
Short answerRust 1.24 was released on Feb 15, 2018: 16 newly stable APIs (RefCell::replace, RefCell::swap, atomic::spin_loop_hint, AtomicBool::new, ...); 9 compatibility notes that can affect existing code. Point release: 1.24.1 (Mar 1, 2018).
← Rust 1.23All versionsRust 1.25 →
16 APIs stabilized
RefCell::replace, RefCell::swap, atomic::spin_loop_hint, AtomicBool::new, AtomicUsize::new, AtomicIsize::new, AtomicPtr::new, Cell::new, {integer}::min_value, {integer}::max_value, mem::size_of, mem::align_of, ptr::null, ptr::null_mut, RefCell::new, UnsafeCell::new
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:
- [Floating point types
Debugimpl now always prints a decimal point.][46831] - [
Ipv6Addrnow rejects superfluous::'s in IPv6 addresses][46671] This is - [Unwinding will no longer go past FFI boundaries, and will instead abort.][46833]
- [
Formatter::flagsmethod is now deprecated.][46284] Thesign_plus, - [Leading zeros in tuple struct members is now an error][47084]
- [
column!()macro is one-based instead of zero-based][46977] - [
fmt::Argumentscan no longer be shared across threads][45198] - [Access to
#[repr(packed)]struct fields is now unsafe][44884] - [Cargo sets a different working directory for the compiler][cargo/4788]
Use it
rustup update stable # get the newest release
rustup install 1.24 # or exactly this one
rustup override set 1.24 # pin a project to itTo require at least this version from users of your crate, set rust-version = "1.24" 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
- [External
sysv64ffi is now available.][46528] eg.extern "sysv64" fn foo () {}
Compiler
- [rustc now uses 16 codegen units by default for release builds.][46910] For the fastest builds, utilize
codegen-units=1. - [Added
armv4t-unknown-linux-gnueabitarget.][47018] - [Add
aarch64-unknown-openbsdsupport][46760]
Libraries
- [
str::find::<char>now uses memchr.][46735] This should lead to a 10x improvement in performance in the majority of cases. - [
OsStr'sDebugimplementation is now lossless and consistent with Windows.][46798] - [
time::{SystemTime, Instant}now implementHash.][46828] - [impl
From<bool>forAtomicBool][46293] - [impl
From<{CString, &CStr}>for{Arc<CStr>, Rc<CStr>}][45990] - [impl
From<{OsString, &OsStr}>for{Arc<OsStr>, Rc<OsStr>}][45990] - [impl
From<{PathBuf, &Path}>for{Arc<Path>, Rc<Path>}][45990] - [float::from_bits now just uses transmute.][46012] This provides some optimisations from LLVM.
- [Copied
AsciiExtmethods ontochar][46077] - [Remove
T: Sizedrequirement onptr::is_null()][46094] - [impl
From<RecvError>for{TryRecvError, RecvTimeoutError}][45506] - [Optimised
f32::{min, max}to generate more efficient x86 assembly][47080] - [
[u8]::containsnow uses memchr which provides a 3x speed improvement][46713]
Stabilized APIs
- [
RefCell::replace] - [
RefCell::swap] - [
atomic::spin_loop_hint]
The following functions can now be used in a constant expression. eg. let buffer: [u8; size_of::<usize>()];, static COUNTER: AtomicUsize = AtomicUsize::new(1);
- [
AtomicBool::new][46287] - [
AtomicUsize::new][46287] - [
AtomicIsize::new][46287] - [
AtomicPtr::new][46287] - [
Cell::new][46287] - [
{integer}::min_value][46287] - [
{integer}::max_value][46287] - [
mem::size_of][46287] - [
mem::align_of][46287] - [
ptr::null][46287] - [
ptr::null_mut][46287] - [
RefCell::new][46287] - [
UnsafeCell::new][46287]
Cargo
- [Added a
workspace.default-membersconfig that overrides implied--allin virtual workspaces.][cargo/4743] - [Enable incremental by default on development builds.][cargo/4817] Also added configuration keys to
Cargo.tomland.cargo/configto disable on a per-project or global basis respectively.
Compatibility Notes
- Floating point types
Debugimpl now always prints a decimal point. Ipv6Addrnow rejects superfluous::'s in IPv6 addresses This is in accordance with IETF RFC 4291 ยง2.2.- Unwinding will no longer go past FFI boundaries, and will instead abort.
Formatter::flagsmethod is now deprecated. Thesign_plus,sign_minus,alternate, andsign_aware_zero_padshould be used instead.- Leading zeros in tuple struct members is now an error
column!()macro is one-based instead of zero-basedfmt::Argumentscan no longer be shared across threads- [Access to
#[repr(packed)]struct fields is now unsafe]44884 - Cargo sets a different working directory for the compiler
1.24.1 (Mar 1, 2018)
Release notes from the Rust project's RELEASES.md (MIT or Apache-2.0); summaries above are ours.
Up next
Next releaseRust 1.25Released Mar 29, 2018.Read it next →Also worth your time
Did this answer your question?