Change8

Migrating to Rust Language 1.94.0

Version 1.94.0 introduces 6 breaking changes. This guide details how to update your code.

Released: 3/5/2026

6
Breaking Changes
6
Migration Steps
15
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

BinaryHeap<T>dyn-typesstd::time::SystemTime::checked_sub_durationmatchesstd::iter::PeekableLazyCellLazyLock[T]::array_windows[T]::element_offsetf32::mul_addf64::mul_addf32::consts::EULER_GAMMAf64::consts::EULER_GAMMAf32::consts::GOLDEN_RATIOf64::consts::GOLDEN_RATIO

Breaking Changes

Issue #1

Closure capturing behavior around patterns has changed. A non-move closure previously capturing an entire variable by move might now capture parts by move and other parts by borrow. This can lead to new borrow checker errors or changes in when `Drop` runs.

Solution

Review closure captures, especially those interacting with pattern matching, and ensure borrows and moves are handled correctly according to the new rules.

Issue #2

Standard library macros are now imported via prelude instead of injected `#[macro_use]`. If a crate glob imports a macro with the same name (e.g., `matches`), it now causes an ambiguity error requiring an explicit import.

Solution

Explicitly import macros if there is a name collision with a standard library macro, or remove the conflicting glob import.

Issue #3

Expression-context `include!(…)`s no longer strip shebangs. Files previously including scripts starting with a shebang might stop compiling.

Solution

Remove leading shebangs from files used within expression-context `include!` macros.

Issue #4

Ambiguous glob reexports are now visible cross-crate, potentially introducing new ambiguity errors where none existed before.

Solution

Resolve ambiguous glob reexports by using explicit imports.

Issue #5

Where-clauses are no longer normalized before checking well-formedness.

Solution

No specific fix mentioned, but code relying on pre-normalization behavior might need review.

Issue #6

Filename handling for cross-compiler consistency has been overhauled. Paths emitted for local crates (path dependencies, workspace members) in diagnostics are now relative instead of absolute.

Solution

Adjust any tooling or scripts relying on absolute paths in compiler diagnostics for local crates.

Migration Steps

  1. 1
    If you rely on closure capturing behavior interacting with pattern matching, review and potentially adjust code to align with the new rules regarding partial moves/borrows.
  2. 2
    If you use glob imports (`use crate::*`) and have custom macros named the same as standard library macros (e.g., `matches`), you must now explicitly import the desired macro to resolve ambiguity.
  3. 3
    Remove shebangs (`#!...`) from files used within expression-context `include!(...)` macros.
  4. 4
    Resolve any new ambiguity errors arising from cross-crate ambiguous glob reexports.
  5. 5
    If using Windows, be aware that `std::time::SystemTime::checked_sub_duration` returns `None` for times before 1/1/1601.
  6. 6
    If you rely on the exact path formatting in compiler diagnostics for local crates in downstream builds, note that these paths are now relative instead of absolute.

Release Summary

This release stabilizes numerous APIs including slice windowing methods, LazyCell/LazyLock methods, and various math constants. It also introduces significant compatibility changes regarding closure capturing behavior and standard library macro imports.

Need More Details?

View the full release notes and all changes for Rust Language 1.94.0.

View Full Changelog