Skip to content

Commit

Permalink
Fix assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Nov 23, 2023
1 parent 75760fe commit ceb5f13
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions compiler/rustc_ty_utils/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,7 @@ fn fn_sig_for_fn_abi<'tcx>(
let ret_ty = Ty::new_adt(tcx, option_adt_ref, option_args);

assert_eq!(sig.return_ty, tcx.types.unit);

// We have to replace the `ResumeTy` that is used for type and borrow checking
// with `()` which is used in codegen.
#[cfg(debug_assertions)]
{
if let ty::Adt(resume_ty_adt, _) = sig.resume_ty.kind() {
let expected_adt =
tcx.adt_def(tcx.require_lang_item(LangItem::ResumeTy, None));
assert_eq!(*resume_ty_adt, expected_adt);
} else {
panic!("expected `ResumeTy`, found `{:?}`", sig.resume_ty);
};
}
assert_eq!(sig.resume_ty, tcx.types.unit);

(None, ret_ty)
}
Expand Down

0 comments on commit ceb5f13

Please sign in to comment.