Fix assertion
This commit is contained in:
parent
988fccb45d
commit
543e559c53
@ -165,19 +165,7 @@ fn fn_sig_for_fn_abi<'tcx>(
|
|||||||
let ret_ty = Ty::new_adt(tcx, option_adt_ref, option_args);
|
let ret_ty = Ty::new_adt(tcx, option_adt_ref, option_args);
|
||||||
|
|
||||||
assert_eq!(sig.return_ty, tcx.types.unit);
|
assert_eq!(sig.return_ty, tcx.types.unit);
|
||||||
|
assert_eq!(sig.resume_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);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
(None, ret_ty)
|
(None, ret_ty)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user