Skip to content

Commit 44ca6bc

Browse files
committed
Apply code review suggestion better
1 parent 0c7f1f9 commit 44ca6bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_mir_transform/src/generator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,15 +749,15 @@ fn sanitize_witness<'tcx>(
749749
}
750750
let decl_ty = tcx.normalize_erasing_regions(param_env, decl.ty);
751751

752-
let is_inhabited = !tcx.is_ty_uninhabited_from(
752+
let is_uninhabited = tcx.is_ty_uninhabited_from(
753753
tcx.parent_module(tcx.hir().local_def_id_to_hir_id(did.expect_local())).to_def_id(),
754754
decl_ty,
755755
param_env,
756756
);
757757

758758
// Sanity check that typeck knows about the type of locals which are
759759
// live across a suspension point
760-
if is_inhabited || allowed.contains(&decl_ty) || allowed_upvars.contains(&decl_ty) {
760+
if is_uninhabited || allowed.contains(&decl_ty) || allowed_upvars.contains(&decl_ty) {
761761
// This type which appears in the generator either...
762762
// - is uninhabited, in which case it can't actually be captured at runtime
763763
// - appears in the approximation from the static type (`allowed`)

0 commit comments

Comments
 (0)