@@ -12,7 +12,7 @@ use crate::prelude::*;
12
12
13
13
pub ( crate ) use self :: returning:: { can_return_to_ssa_var, codegen_return} ;
14
14
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
16
16
pub ( crate ) fn fn_sig_for_fn_abi < ' tcx > ( tcx : TyCtxt < ' tcx > , instance : Instance < ' tcx > ) -> ty:: PolyFnSig < ' tcx > {
17
17
let ty = instance. monomorphic_ty ( tcx) ;
18
18
match ty. kind {
@@ -43,7 +43,7 @@ pub(crate) fn fn_sig_for_fn_abi<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx
43
43
sig. abi
44
44
) )
45
45
}
46
- ty:: Generator ( _def_id , substs, _) => {
46
+ ty:: Generator ( _ , substs, _) => {
47
47
let sig = substs. as_generator ( ) . poly_sig ( ) ;
48
48
49
49
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
63
63
] ) ;
64
64
let ret_ty = tcx. mk_adt ( state_adt_ref, state_substs) ;
65
65
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,
68
69
false ,
69
70
rustc_hir:: Unsafety :: Normal ,
70
71
rustc_target:: spec:: abi:: Abi :: Rust
0 commit comments