Skip to content

Commit 495ff00

Browse files
committed
Fixup feature(never_type_fallback) handling
1 parent 8bfc0c5 commit 495ff00

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_hir_typeck/src/fallback.rs

+4
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
100100
.get_attr(CRATE_DEF_ID, sym::rustc_never_type_mode)
101101
.map(|attr| (attr.value_str().unwrap(), attr.span))
102102
else {
103+
if self.tcx.features().never_type_fallback {
104+
return DivergingFallbackBehavior::FallbackToNiko;
105+
}
106+
103107
return DivergingFallbackBehavior::FallbackToUnit;
104108
};
105109

0 commit comments

Comments
 (0)