1414
1515use rustc_data_structures:: fx:: FxHashMap ;
1616use rustc_errors:: Diagnostic ;
17- use rustc_hir as hir;
1817use rustc_hir:: def_id:: { DefId , LocalDefId } ;
1918use rustc_hir:: lang_items:: LangItem ;
2019use rustc_hir:: BodyOwnerKind ;
@@ -94,7 +93,7 @@ pub enum DefiningTy<'tcx> {
9493 /// The MIR is a coroutine. The signature is that coroutines take
9594 /// no parameters and return the result of
9695 /// `ClosureArgs::coroutine_return_ty`.
97- Coroutine ( DefId , GenericArgsRef < ' tcx > , hir :: Movability ) ,
96+ Coroutine ( DefId , GenericArgsRef < ' tcx > ) ,
9897
9998 /// The MIR is a fn item with the given `DefId` and args. The signature
10099 /// of the function can be bound then with the `fn_sig` query.
@@ -118,7 +117,7 @@ impl<'tcx> DefiningTy<'tcx> {
118117 pub fn upvar_tys ( self ) -> & ' tcx ty:: List < Ty < ' tcx > > {
119118 match self {
120119 DefiningTy :: Closure ( _, args) => args. as_closure ( ) . upvar_tys ( ) ,
121- DefiningTy :: Coroutine ( _, args, _ ) => args. as_coroutine ( ) . upvar_tys ( ) ,
120+ DefiningTy :: Coroutine ( _, args) => args. as_coroutine ( ) . upvar_tys ( ) ,
122121 DefiningTy :: FnDef ( ..) | DefiningTy :: Const ( ..) | DefiningTy :: InlineConst ( ..) => {
123122 ty:: List :: empty ( )
124123 }
@@ -354,7 +353,7 @@ impl<'tcx> UniversalRegions<'tcx> {
354353 err. note ( format ! ( "late-bound region is {:?}" , self . to_region_vid( r) ) ) ;
355354 } ) ;
356355 }
357- DefiningTy :: Coroutine ( def_id, args, _ ) => {
356+ DefiningTy :: Coroutine ( def_id, args) => {
358357 let v = with_no_trimmed_paths ! (
359358 args[ tcx. generics_of( def_id) . parent_count..]
360359 . iter( )
@@ -527,7 +526,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
527526 debug ! ( "build: local regions = {}..{}" , first_local_index, num_universals) ;
528527
529528 let yield_ty = match defining_ty {
530- DefiningTy :: Coroutine ( _, args, _ ) => Some ( args. as_coroutine ( ) . yield_ty ( ) ) ,
529+ DefiningTy :: Coroutine ( _, args) => Some ( args. as_coroutine ( ) . yield_ty ( ) ) ,
531530 _ => None ,
532531 } ;
533532
@@ -562,9 +561,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
562561
563562 match * defining_ty. kind ( ) {
564563 ty:: Closure ( def_id, args) => DefiningTy :: Closure ( def_id, args) ,
565- ty:: Coroutine ( def_id, args, movability) => {
566- DefiningTy :: Coroutine ( def_id, args, movability)
567- }
564+ ty:: Coroutine ( def_id, args) => DefiningTy :: Coroutine ( def_id, args) ,
568565 ty:: FnDef ( def_id, args) => DefiningTy :: FnDef ( def_id, args) ,
569566 _ => span_bug ! (
570567 tcx. def_span( self . mir_def) ,
@@ -620,7 +617,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
620617 let identity_args = GenericArgs :: identity_for_item ( tcx, typeck_root_def_id) ;
621618 let fr_args = match defining_ty {
622619 DefiningTy :: Closure ( _, args)
623- | DefiningTy :: Coroutine ( _, args, _ )
620+ | DefiningTy :: Coroutine ( _, args)
624621 | DefiningTy :: InlineConst ( _, args) => {
625622 // In the case of closures, we rely on the fact that
626623 // the first N elements in the ClosureArgs are
@@ -685,11 +682,11 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
685682 )
686683 }
687684
688- DefiningTy :: Coroutine ( def_id, args, movability ) => {
685+ DefiningTy :: Coroutine ( def_id, args) => {
689686 assert_eq ! ( self . mir_def. to_def_id( ) , def_id) ;
690687 let resume_ty = args. as_coroutine ( ) . resume_ty ( ) ;
691688 let output = args. as_coroutine ( ) . return_ty ( ) ;
692- let coroutine_ty = Ty :: new_coroutine ( tcx, def_id, args, movability ) ;
689+ let coroutine_ty = Ty :: new_coroutine ( tcx, def_id, args) ;
693690 let inputs_and_output =
694691 self . infcx . tcx . mk_type_list ( & [ coroutine_ty, resume_ty, output] ) ;
695692 ty:: Binder :: dummy ( inputs_and_output)
0 commit comments