@@ -12,7 +12,7 @@ use crate::prelude::*;
1212
1313pub ( crate ) use self :: returning:: { can_return_to_ssa_var, codegen_return} ;
1414
15- // Copied from https://github.com/rust-lang/rust/blob/c2f4c57296f0d929618baed0b0d6eb594abf01eb /src/librustc /ty/layout.rs#L2349
15+ // Copied from https://github.com/rust-lang/rust/blob/b2c1a606feb1fbdb0ac0acba76f881ef172ed474 /src/librustc_middle /ty/layout.rs#L2287
1616pub ( crate ) fn fn_sig_for_fn_abi < ' tcx > ( tcx : TyCtxt < ' tcx > , instance : Instance < ' tcx > ) -> ty:: PolyFnSig < ' tcx > {
1717 let ty = instance. monomorphic_ty ( tcx) ;
1818 match ty. kind {
@@ -43,7 +43,7 @@ pub(crate) fn fn_sig_for_fn_abi<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx
4343 sig. abi
4444 ) )
4545 }
46- ty:: Generator ( _def_id , substs, _) => {
46+ ty:: Generator ( _ , substs, _) => {
4747 let sig = substs. as_generator ( ) . poly_sig ( ) ;
4848
4949 let env_region = ty:: ReLateBound ( ty:: INNERMOST , ty:: BrEnv ) ;
@@ -63,8 +63,9 @@ pub(crate) fn fn_sig_for_fn_abi<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx
6363 ] ) ;
6464 let ret_ty = tcx. mk_adt ( state_adt_ref, state_substs) ;
6565
66- tcx. mk_fn_sig ( std:: iter:: once ( env_ty) ,
67- ret_ty,
66+ tcx. mk_fn_sig (
67+ [ env_ty, sig. resume_ty ] . iter ( ) ,
68+ & ret_ty,
6869 false ,
6970 rustc_hir:: Unsafety :: Normal ,
7071 rustc_target:: spec:: abi:: Abi :: Rust
0 commit comments