use TypingEnv when no infcx is available
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
This commit is contained in:
@@ -9,7 +9,7 @@ pub(super) fn partially_check_layout<'tcx>(cx: &LayoutCx<'tcx>, layout: &TyAndLa
|
||||
let tcx = cx.tcx();
|
||||
|
||||
// Type-level uninhabitedness should always imply ABI uninhabitedness.
|
||||
if layout.ty.is_privately_uninhabited(tcx, cx.param_env) {
|
||||
if layout.ty.is_privately_uninhabited(tcx, cx.typing_env) {
|
||||
assert!(layout.is_uninhabited());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user