@@ -671,6 +671,17 @@ fn encode_ty<'tcx>(
671
671
typeid. push_str ( & s) ;
672
672
}
673
673
674
+ ty:: CoroutineWitness ( def_id, args, ..) => {
675
+ // u<length><name>[I<element-type1..element-typeN>E], where <element-type> is <subst>,
676
+ // as vendor extended type.
677
+ let mut s = String :: new ( ) ;
678
+ let name = encode_ty_name ( tcx, * def_id) ;
679
+ let _ = write ! ( s, "u{}{}" , name. len( ) , & name) ;
680
+ s. push_str ( & encode_args ( tcx, args, dict, options) ) ;
681
+ compress ( dict, DictKey :: Ty ( ty, TyQ :: None ) , & mut s) ;
682
+ typeid. push_str ( & s) ;
683
+ }
684
+
674
685
// Pointer types
675
686
ty:: Ref ( region, ty0, ..) => {
676
687
// [U3mut]u3refI<element-type>E as vendor extended type qualifier and type
@@ -732,12 +743,7 @@ fn encode_ty<'tcx>(
732
743
}
733
744
734
745
// Unexpected types
735
- ty:: Alias ( ..)
736
- | ty:: Bound ( ..)
737
- | ty:: Error ( ..)
738
- | ty:: CoroutineWitness ( ..)
739
- | ty:: Infer ( ..)
740
- | ty:: Placeholder ( ..) => {
746
+ ty:: Alias ( ..) | ty:: Bound ( ..) | ty:: Error ( ..) | ty:: Infer ( ..) | ty:: Placeholder ( ..) => {
741
747
bug ! ( "encode_ty: unexpected `{:?}`" , ty. kind( ) ) ;
742
748
}
743
749
} ;
@@ -790,7 +796,7 @@ fn transform_ty<'tcx>(
790
796
options : TransformTyOptions ,
791
797
) -> Ty < ' tcx > {
792
798
match ty. kind ( ) {
793
- ty:: Float ( ..) | ty:: Str | ty:: Never | ty:: Foreign ( ..) | ty :: CoroutineWitness ( .. ) => { }
799
+ ty:: Float ( ..) | ty:: Str | ty:: Never | ty:: Foreign ( ..) => { }
794
800
795
801
ty:: Bool => {
796
802
if options. contains ( EncodeTyOptions :: NORMALIZE_INTEGERS ) {
@@ -934,6 +940,14 @@ fn transform_ty<'tcx>(
934
940
ty = Ty :: new_coroutine ( tcx, * def_id, transform_args ( tcx, args, parents, options) ) ;
935
941
}
936
942
943
+ ty:: CoroutineWitness ( def_id, args) => {
944
+ ty = Ty :: new_coroutine_witness (
945
+ tcx,
946
+ * def_id,
947
+ transform_args ( tcx, args, parents, options) ,
948
+ ) ;
949
+ }
950
+
937
951
ty:: Ref ( region, ty0, ..) => {
938
952
if options. contains ( TransformTyOptions :: GENERALIZE_POINTERS ) {
939
953
if ty. is_mutable_ptr ( ) {
0 commit comments