14
14
15
15
use rustc_data_structures:: fx:: FxHashMap ;
16
16
use rustc_errors:: Diagnostic ;
17
- use rustc_hir as hir;
18
17
use rustc_hir:: def_id:: { DefId , LocalDefId } ;
19
18
use rustc_hir:: lang_items:: LangItem ;
20
19
use rustc_hir:: BodyOwnerKind ;
@@ -94,7 +93,7 @@ pub enum DefiningTy<'tcx> {
94
93
/// The MIR is a coroutine. The signature is that coroutines take
95
94
/// no parameters and return the result of
96
95
/// `ClosureArgs::coroutine_return_ty`.
97
- Coroutine ( DefId , GenericArgsRef < ' tcx > , hir :: Movability ) ,
96
+ Coroutine ( DefId , GenericArgsRef < ' tcx > ) ,
98
97
99
98
/// The MIR is a fn item with the given `DefId` and args. The signature
100
99
/// of the function can be bound then with the `fn_sig` query.
@@ -118,7 +117,7 @@ impl<'tcx> DefiningTy<'tcx> {
118
117
pub fn upvar_tys ( self ) -> & ' tcx ty:: List < Ty < ' tcx > > {
119
118
match self {
120
119
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 ( ) ,
122
121
DefiningTy :: FnDef ( ..) | DefiningTy :: Const ( ..) | DefiningTy :: InlineConst ( ..) => {
123
122
ty:: List :: empty ( )
124
123
}
@@ -354,7 +353,7 @@ impl<'tcx> UniversalRegions<'tcx> {
354
353
err. note ( format ! ( "late-bound region is {:?}" , self . to_region_vid( r) ) ) ;
355
354
} ) ;
356
355
}
357
- DefiningTy :: Coroutine ( def_id, args, _ ) => {
356
+ DefiningTy :: Coroutine ( def_id, args) => {
358
357
let v = with_no_trimmed_paths ! (
359
358
args[ tcx. generics_of( def_id) . parent_count..]
360
359
. iter( )
@@ -527,7 +526,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
527
526
debug ! ( "build: local regions = {}..{}" , first_local_index, num_universals) ;
528
527
529
528
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 ( ) ) ,
531
530
_ => None ,
532
531
} ;
533
532
@@ -562,9 +561,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
562
561
563
562
match * defining_ty. kind ( ) {
564
563
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) ,
568
565
ty:: FnDef ( def_id, args) => DefiningTy :: FnDef ( def_id, args) ,
569
566
_ => span_bug ! (
570
567
tcx. def_span( self . mir_def) ,
@@ -620,7 +617,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
620
617
let identity_args = GenericArgs :: identity_for_item ( tcx, typeck_root_def_id) ;
621
618
let fr_args = match defining_ty {
622
619
DefiningTy :: Closure ( _, args)
623
- | DefiningTy :: Coroutine ( _, args, _ )
620
+ | DefiningTy :: Coroutine ( _, args)
624
621
| DefiningTy :: InlineConst ( _, args) => {
625
622
// In the case of closures, we rely on the fact that
626
623
// the first N elements in the ClosureArgs are
@@ -685,11 +682,11 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
685
682
)
686
683
}
687
684
688
- DefiningTy :: Coroutine ( def_id, args, movability ) => {
685
+ DefiningTy :: Coroutine ( def_id, args) => {
689
686
assert_eq ! ( self . mir_def. to_def_id( ) , def_id) ;
690
687
let resume_ty = args. as_coroutine ( ) . resume_ty ( ) ;
691
688
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) ;
693
690
let inputs_and_output =
694
691
self . infcx . tcx . mk_type_list ( & [ coroutine_ty, resume_ty, output] ) ;
695
692
ty:: Binder :: dummy ( inputs_and_output)
0 commit comments