Email me

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).

Feb 15, 2018release date
0language stabilizations
16APIs stabilized
-new edition

← 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 Debug impl now always prints a decimal point.][46831]
  • [Ipv6Addr now rejects superfluous ::'s in IPv6 addresses][46671] This is
  • [Unwinding will no longer go past FFI boundaries, and will instead abort.][46833]
  • [Formatter::flags method is now deprecated.][46284] The sign_plus,
  • [Leading zeros in tuple struct members is now an error][47084]
  • [column!() macro is one-based instead of zero-based][46977]
  • [fmt::Arguments can 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 it

To 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 sysv64 ffi 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-gnueabi target.][47018]
  • [Add aarch64-unknown-openbsd support][46760]

Libraries

  • [str::find::<char> now uses memchr.][46735] This should lead to a 10x improvement in performance in the majority of cases.
  • [OsStr's Debug implementation is now lossless and consistent with Windows.][46798]
  • [time::{SystemTime, Instant} now implement Hash.][46828]
  • [impl From<bool> for AtomicBool][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 AsciiExt methods onto char][46077]
  • [Remove T: Sized requirement on ptr::is_null()][46094]
  • [impl From<RecvError> for {TryRecvError, RecvTimeoutError}][45506]
  • [Optimised f32::{min, max} to generate more efficient x86 assembly][47080]
  • [[u8]::contains now 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-members config that overrides implied --all in virtual workspaces.][cargo/4743]
  • [Enable incremental by default on development builds.][cargo/4817] Also added configuration keys to Cargo.toml and .cargo/config to disable on a per-project or global basis respectively.

Compatibility Notes

1.24.1 (Mar 1, 2018)

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

← Rust 1.23All versionsRust 1.25 →

Up next

Next releaseRust 1.25Released Mar 29, 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