Skip to content

Commit 437303e

Browse files
committed
FRTs are uninhabited
1 parent f92fc96 commit 437303e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

compiler/rustc_middle/src/ty/layout.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ where
805805
| ty::Float(_)
806806
| ty::FnPtr(..)
807807
| ty::Never
808+
| ty::Field(..)
808809
| ty::FnDef(..)
809810
| ty::CoroutineWitness(..)
810811
| ty::Foreign(..)

compiler/rustc_ty_utils/src/layout.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,8 @@ fn layout_of_uncached<'tcx>(
676676
tcx.mk_layout(layout)
677677
}
678678

679+
ty::Field(..) => tcx.mk_layout(LayoutData::never_type(cx)),
680+
679681
ty::UnsafeBinder(bound_ty) => {
680682
let ty = tcx.instantiate_bound_regions_with_erased(bound_ty.into());
681683
cx.layout_of(ty)?.layout

0 commit comments

Comments
 (0)