@@ -641,9 +641,7 @@ fn encode_ty<'tcx>(
641
641
}
642
642
643
643
// Function types
644
- ty:: FnDef ( def_id, args)
645
- | ty:: Closure ( def_id, args)
646
- | ty:: CoroutineClosure ( def_id, args) => {
644
+ ty:: FnDef ( def_id, args) | ty:: Closure ( def_id, args) => {
647
645
// u<length><name>[I<element-type1..element-typeN>E], where <element-type> is <subst>,
648
646
// as vendor extended type.
649
647
let mut s = String :: new ( ) ;
@@ -653,6 +651,17 @@ fn encode_ty<'tcx>(
653
651
compress ( dict, DictKey :: Ty ( ty, TyQ :: None ) , & mut s) ;
654
652
typeid. push_str ( & s) ;
655
653
}
654
+ ty:: CoroutineClosure ( def_id, args) => {
655
+ // u<length><name>[I<element-type1..element-typeN>E], where <element-type> is <subst>,
656
+ // as vendor extended type.
657
+ let mut s = String :: new ( ) ;
658
+ let name = encode_ty_name ( tcx, * def_id) ;
659
+ let _ = write ! ( s, "u{}{}" , name. len( ) , & name) ;
660
+ let parent_args = tcx. mk_args ( args. as_coroutine_closure ( ) . parent_args ( ) ) ;
661
+ s. push_str ( & encode_args ( tcx, parent_args, dict, options) ) ;
662
+ compress ( dict, DictKey :: Ty ( ty, TyQ :: None ) , & mut s) ;
663
+ typeid. push_str ( & s) ;
664
+ }
656
665
657
666
ty:: Coroutine ( def_id, args, ..) => {
658
667
// u<length><name>[I<element-type1..element-typeN>E], where <element-type> is <subst>,
@@ -735,8 +744,8 @@ fn encode_ty<'tcx>(
735
744
ty:: Alias ( ..)
736
745
| ty:: Bound ( ..)
737
746
| ty:: Error ( ..)
738
- | ty:: CoroutineWitness ( ..)
739
747
| ty:: Infer ( ..)
748
+ | ty:: CoroutineWitness ( ..)
740
749
| ty:: Placeholder ( ..) => {
741
750
bug ! ( "encode_ty: unexpected `{:?}`" , ty. kind( ) ) ;
742
751
}
@@ -922,6 +931,10 @@ fn transform_ty<'tcx>(
922
931
ty = Ty :: new_closure ( tcx, * def_id, transform_args ( tcx, args, parents, options) ) ;
923
932
}
924
933
934
+ ty:: Coroutine ( def_id, args) => {
935
+ ty = Ty :: new_coroutine ( tcx, * def_id, transform_args ( tcx, args, parents, options) ) ;
936
+ }
937
+
925
938
ty:: CoroutineClosure ( def_id, args) => {
926
939
ty = Ty :: new_coroutine_closure (
927
940
tcx,
@@ -930,10 +943,6 @@ fn transform_ty<'tcx>(
930
943
) ;
931
944
}
932
945
933
- ty:: Coroutine ( def_id, args) => {
934
- ty = Ty :: new_coroutine ( tcx, * def_id, transform_args ( tcx, args, parents, options) ) ;
935
- }
936
-
937
946
ty:: Ref ( region, ty0, ..) => {
938
947
if options. contains ( TransformTyOptions :: GENERALIZE_POINTERS ) {
939
948
if ty. is_mutable_ptr ( ) {
0 commit comments