@@ -671,6 +671,17 @@ fn encode_ty<'tcx>(
671671 typeid. push_str ( & s) ;
672672 }
673673
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+
674685 // Pointer types
675686 ty:: Ref ( region, ty0, ..) => {
676687 // [U3mut]u3refI<element-type>E as vendor extended type qualifier and type
@@ -732,12 +743,7 @@ fn encode_ty<'tcx>(
732743 }
733744
734745 // 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 ( ..) => {
741747 bug ! ( "encode_ty: unexpected `{:?}`" , ty. kind( ) ) ;
742748 }
743749 } ;
@@ -790,7 +796,7 @@ fn transform_ty<'tcx>(
790796 options : TransformTyOptions ,
791797) -> Ty < ' tcx > {
792798 match ty. kind ( ) {
793- ty:: Float ( ..) | ty:: Str | ty:: Never | ty:: Foreign ( ..) | ty :: CoroutineWitness ( .. ) => { }
799+ ty:: Float ( ..) | ty:: Str | ty:: Never | ty:: Foreign ( ..) => { }
794800
795801 ty:: Bool => {
796802 if options. contains ( EncodeTyOptions :: NORMALIZE_INTEGERS ) {
@@ -934,6 +940,14 @@ fn transform_ty<'tcx>(
934940 ty = Ty :: new_coroutine ( tcx, * def_id, transform_args ( tcx, args, parents, options) ) ;
935941 }
936942
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+
937951 ty:: Ref ( region, ty0, ..) => {
938952 if options. contains ( TransformTyOptions :: GENERALIZE_POINTERS ) {
939953 if ty. is_mutable_ptr ( ) {
0 commit comments