@@ -272,7 +272,7 @@ impl<'tcx> GotocCtx<'tcx> {
272272 let env = prev_args[ 0 ] ;
273273
274274 // Recombine arguments: environment first, then the flattened tuple elements
275- let recombined_args = iter:: once ( env) . chain ( args) ;
275+ let recombined_args: Vec < _ > = iter:: once ( env) . chain ( args) . collect ( ) ;
276276
277277 return ty:: Binder :: bind_with_vars (
278278 self . tcx . mk_fn_sig (
@@ -297,7 +297,7 @@ impl<'tcx> GotocCtx<'tcx> {
297297
298298 // In addition to `def_id` and `substs`, we need to provide the kind of region `env_region`
299299 // in `closure_env_ty`, which we can build from the bound variables as follows
300- let bound_vars = self . tcx . mk_bound_variable_kinds (
300+ let bound_vars = self . tcx . mk_bound_variable_kinds_from_iter (
301301 sig. bound_vars ( ) . iter ( ) . chain ( iter:: once ( ty:: BoundVariableKind :: Region ( ty:: BrEnv ) ) ) ,
302302 ) ;
303303 let br = ty:: BoundRegion {
@@ -314,7 +314,7 @@ impl<'tcx> GotocCtx<'tcx> {
314314 // * the rest of attributes are obtained from `sig`
315315 let sig = ty:: Binder :: bind_with_vars (
316316 self . tcx . mk_fn_sig (
317- iter :: once ( env_ty) . chain ( iter :: once ( sig. inputs ( ) [ 0 ] ) ) ,
317+ [ env_ty, sig. inputs ( ) [ 0 ] ] ,
318318 sig. output ( ) ,
319319 sig. c_variadic ,
320320 sig. unsafety ,
@@ -338,19 +338,19 @@ impl<'tcx> GotocCtx<'tcx> {
338338 ) -> ty:: PolyFnSig < ' tcx > {
339339 let sig = substs. as_generator ( ) . poly_sig ( ) ;
340340
341- let bound_vars = self . tcx . mk_bound_variable_kinds (
341+ let bound_vars = self . tcx . mk_bound_variable_kinds_from_iter (
342342 sig. bound_vars ( ) . iter ( ) . chain ( iter:: once ( ty:: BoundVariableKind :: Region ( ty:: BrEnv ) ) ) ,
343343 ) ;
344344 let br = ty:: BoundRegion {
345345 var : ty:: BoundVar :: from_usize ( bound_vars. len ( ) - 1 ) ,
346346 kind : ty:: BoundRegionKind :: BrEnv ,
347347 } ;
348348 let env_region = ty:: ReLateBound ( ty:: INNERMOST , br) ;
349- let env_ty = self . tcx . mk_mut_ref ( self . tcx . mk_region ( env_region) , ty) ;
349+ let env_ty = self . tcx . mk_mut_ref ( self . tcx . mk_region_from_kind ( env_region) , ty) ;
350350
351351 let pin_did = self . tcx . require_lang_item ( LangItem :: Pin , None ) ;
352352 let pin_adt_ref = self . tcx . adt_def ( pin_did) ;
353- let pin_substs = self . tcx . intern_substs ( & [ env_ty. into ( ) ] ) ;
353+ let pin_substs = self . tcx . mk_substs ( & [ env_ty. into ( ) ] ) ;
354354 let env_ty = self . tcx . mk_adt ( pin_adt_ref, pin_substs) ;
355355
356356 let sig = sig. skip_binder ( ) ;
@@ -363,7 +363,7 @@ impl<'tcx> GotocCtx<'tcx> {
363363 // The signature should be `Future::poll(_, &mut Context<'_>) -> Poll<Output>`
364364 let poll_did = tcx. require_lang_item ( LangItem :: Poll , None ) ;
365365 let poll_adt_ref = tcx. adt_def ( poll_did) ;
366- let poll_substs = tcx. intern_substs ( & [ sig. return_ty . into ( ) ] ) ;
366+ let poll_substs = tcx. mk_substs ( & [ sig. return_ty . into ( ) ] ) ;
367367 let ret_ty = tcx. mk_adt ( poll_adt_ref, poll_substs) ;
368368
369369 // We have to replace the `ResumeTy` that is used for type and borrow checking
@@ -384,16 +384,16 @@ impl<'tcx> GotocCtx<'tcx> {
384384 // The signature should be `Generator::resume(_, Resume) -> GeneratorState<Yield, Return>`
385385 let state_did = tcx. require_lang_item ( LangItem :: GeneratorState , None ) ;
386386 let state_adt_ref = tcx. adt_def ( state_did) ;
387- let state_substs = tcx. intern_substs ( & [ sig. yield_ty . into ( ) , sig. return_ty . into ( ) ] ) ;
387+ let state_substs = tcx. mk_substs ( & [ sig. yield_ty . into ( ) , sig. return_ty . into ( ) ] ) ;
388388 let ret_ty = tcx. mk_adt ( state_adt_ref, state_substs) ;
389389
390390 ( sig. resume_ty , ret_ty)
391391 } ;
392392
393393 ty:: Binder :: bind_with_vars (
394394 tcx. mk_fn_sig (
395- [ env_ty, resume_ty] . iter ( ) ,
396- & ret_ty,
395+ [ env_ty, resume_ty] ,
396+ ret_ty,
397397 false ,
398398 Unsafety :: Normal ,
399399 rustc_target:: spec:: abi:: Abi :: Rust ,
@@ -423,7 +423,7 @@ impl<'tcx> GotocCtx<'tcx> {
423423impl < ' tcx > GotocCtx < ' tcx > {
424424 pub fn monomorphize < T > ( & self , value : T ) -> T
425425 where
426- T : TypeFoldable < ' tcx > ,
426+ T : TypeFoldable < TyCtxt < ' tcx > > ,
427427 {
428428 // Instance is Some(..) only when current codegen unit is a function.
429429 if let Some ( current_fn) = & self . current_fn {
0 commit comments