Skip to content

Commit 31a8879

Browse files
committed
Edition 2024: Make ! fallback to !
1 parent 47334d2 commit 31a8879

File tree

1 file changed

+5
-0
lines changed
  • compiler/rustc_hir_typeck/src/fn_ctxt

1 file changed

+5
-0
lines changed

compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,11 @@ fn never_type_behavior(tcx: TyCtxt<'_>) -> (DivergingFallbackBehavior, Diverging
392392
fn default_fallback(tcx: TyCtxt<'_>) -> DivergingFallbackBehavior {
393393
use DivergingFallbackBehavior::*;
394394

395+
// Edition 2024: fallback to `!`
396+
if tcx.sess.edition().at_least_rust_2024() {
397+
return FallbackToNever;
398+
}
399+
395400
// `feature(never_type_fallback)`: fallback to `!` or `()` trying to not break stuff
396401
if tcx.features().never_type_fallback {
397402
return FallbackToNiko;

0 commit comments

Comments
 (0)