Rust 1.92 : stabilité du never type, avertissement unused_must_see
lun, 15/12/2025 - 17:35
Rust arrive en version 1.92. Vous pouvez l'installer dès maintenant : rustup update stable. Une des nouveautés les plus importantes concerne la stabilisation du never type, plus précisement du type primitif never. Avec cette version, never_type_fallback_flowing_into_unsafe et dependency_on_unit_never_type_fallback sont refusés par défaut. Ils peuvent provoquer une erreur de compilation si ces types sont détectés.
L'équipe langage et compilation estime que 500 crates sont concernés sur ce lint et la stabilité du type never.
Autre nouveautés, unused_must_use se doit plus retourner de warnings sur Resultat<(), UninhabitedType>.
Les autres nouveautés :
- émettre des tableaux de déroulement même si -Cpanic=about est activié sur Linux
- valider une entrée macro_export
- stabilisation d'API : le travail se poursuit :
NonZero<u{N}>::div_ceilLocation::file_as_c_strRwLockWriteGuard::downgradeBox::new_zeroedBox::new_zeroed_sliceRc::new_zeroedRc::new_zeroed_sliceArc::new_zeroedArc::new_zeroed_slicebtree_map::Entry::insert_entrybtree_map::VacantEntry::insert_entryimpl Extend<proc_macro::Group> for proc_macro::TokenStreamimpl Extend<proc_macro::Literal> for proc_macro::TokenStreamimpl Extend<proc_macro::Punct> for proc_macro::TokenStreamimpl Extend<proc_macro::Ident> for proc_macro::TokenStream
Détails des améliorations :
1 / le langage
- Document
MaybeUninitrepresentation and validity - Allow
&raw [mut | const]for union field in safe code - Prefer item bounds of associated types over where-bounds for auto-traits and
Sized - Do not materialize
Xin[X; 0]whenXis unsizing a const - Support combining
#[track_caller]and#[no_mangle](requires every declaration specifying#[track_caller]as well) - Make never type lints
never_type_fallback_flowing_into_unsafeanddependency_on_unit_never_type_fallbackdeny-by-default - Allow specifying multiple bounds for same associated item, except in trait objects
- Slightly strengthen higher-ranked region handling in coherence
- The
unused_must_uselint no longer warns onResult<(), Uninhabited>(for instance,Result<(), !>), orControlFlow<Uninhabited, ()>. This avoids having to check for an error that can never happen.
2 / le compilateur
- Make
mips64el-unknown-linux-muslabi64link dynamically - Remove current code for embedding command-line args in PDB
3 / Cargo : ajout d'un nouveau chapitre dans la documentation : Optimizing build performance
Note de version complète : https://doc.rust-lang.org/stable/releases.html#version-1920-2025-12-11

