@@ -747,9 +747,13 @@ impl<'tcx> TyCtxt<'tcx> {
747747 match def_kind {
748748 DefKind :: AssocFn if self . associated_item ( def_id) . fn_has_self_parameter => "method" ,
749749 DefKind :: Coroutine => match self . coroutine_kind ( def_id) . unwrap ( ) {
750- rustc_hir:: CoroutineKind :: Async ( ..) => "async closure" ,
751- rustc_hir:: CoroutineKind :: Coroutine => "coroutine" ,
752- rustc_hir:: CoroutineKind :: Gen ( ..) => "gen closure" ,
750+ hir:: CoroutineKind :: Async ( hir:: CoroutineSource :: Fn ) => "async fn" ,
751+ hir:: CoroutineKind :: Async ( hir:: CoroutineSource :: Block ) => "async block" ,
752+ hir:: CoroutineKind :: Async ( hir:: CoroutineSource :: Closure ) => "async closure" ,
753+ hir:: CoroutineKind :: Gen ( hir:: CoroutineSource :: Fn ) => "gen fn" ,
754+ hir:: CoroutineKind :: Gen ( hir:: CoroutineSource :: Block ) => "gen block" ,
755+ hir:: CoroutineKind :: Gen ( hir:: CoroutineSource :: Closure ) => "gen closure" ,
756+ hir:: CoroutineKind :: Coroutine => "coroutine" ,
753757 } ,
754758 _ => def_kind. descr ( def_id) ,
755759 }
@@ -765,9 +769,9 @@ impl<'tcx> TyCtxt<'tcx> {
765769 match def_kind {
766770 DefKind :: AssocFn if self . associated_item ( def_id) . fn_has_self_parameter => "a" ,
767771 DefKind :: Coroutine => match self . coroutine_kind ( def_id) . unwrap ( ) {
768- rustc_hir :: CoroutineKind :: Async ( ..) => "an" ,
769- rustc_hir :: CoroutineKind :: Coroutine => "a" ,
770- rustc_hir :: CoroutineKind :: Gen ( ..) => "a" ,
772+ hir :: CoroutineKind :: Async ( ..) => "an" ,
773+ hir :: CoroutineKind :: Coroutine => "a" ,
774+ hir :: CoroutineKind :: Gen ( ..) => "a" ,
771775 } ,
772776 _ => def_kind. article ( ) ,
773777 }
@@ -850,18 +854,7 @@ impl<'tcx> OpaqueTypeExpander<'tcx> {
850854 }
851855 let args = args. fold_with ( self ) ;
852856 if !self . check_recursion || self . seen_opaque_tys . insert ( def_id) {
853- let expanded_ty = match self . expanded_cache . get ( & ( def_id, args) ) {
854- Some ( expanded_ty) => * expanded_ty,
855- None => {
856- for bty in self . tcx . coroutine_hidden_types ( def_id) {
857- let hidden_ty = bty. instantiate ( self . tcx , args) ;
858- self . fold_ty ( hidden_ty) ;
859- }
860- let expanded_ty = Ty :: new_coroutine_witness ( self . tcx , def_id, args) ;
861- self . expanded_cache . insert ( ( def_id, args) , expanded_ty) ;
862- expanded_ty
863- }
864- } ;
857+ let expanded_ty = Ty :: new_coroutine_witness ( self . tcx , def_id, args) ;
865858 if self . check_recursion {
866859 self . seen_opaque_tys . remove ( & def_id) ;
867860 }
0 commit comments