Rustacean Station

What's New in the Rust 2024 Edition

17 snips
Jan 23, 2026
A lively tour of the Rust 2024 Edition's biggest language and tooling changes. They hit RPIT lifetime capture rules, let-chain and temporary drop behavior, and match ergonomics restrictions. Unsafe-related shifts get lots of attention, from extern blocks to newly unsafe std functions. Cargo and rustdoc updates, macro fragment changes, and a reserved gen keyword round out the conversation.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ADVICE

Avoid References To static mut

  • Avoid using static mut; prefer non-mutable statics with interior mutability (Atomics, Mutex, OnceLock) or raw pointers when you truly control safety.
  • If you must use mutable globals, wrap them with a properly synchronized interior-mutable type and access via raw pointers only.
INSIGHT

Never Type Stops Falling Back To Unit

  • The never type (!) will no longer fall back to unit in the 2024 edition, preventing unsafe inference surprises.
  • A new deny-by-default lint blocks cases where ! previously coerced to () and flowed into unsafe code.
INSIGHT

Macro Fragments Are Edition-Aware

  • Macro fragment specifiers now distinguish between edition meanings: expr in 2024 includes const/underscore, while expr_2021 preserves older parsing.
  • This preserves macro cross-crate compatibility by binding fragment semantics to the edition of the macro definition.
Get the Snipd Podcast app to discover more snips from this episode
Get the app