@@ -101,7 +101,6 @@ use crate::{self as ty, Interner};
101
101
/// `yield` inside the coroutine.
102
102
/// * `GR`: The "return type", which is the type of value returned upon
103
103
/// completion of the coroutine.
104
- /// * `GW`: The "coroutine witness".
105
104
#[ derive_where( Clone , Copy , PartialEq , Eq , Hash , Debug ; I : Interner ) ]
106
105
#[ derive( TypeVisitable_Generic , TypeFoldable_Generic , Lift_Generic ) ]
107
106
pub struct ClosureArgs < I : Interner > {
@@ -239,8 +238,6 @@ pub struct CoroutineClosureArgsParts<I: Interner> {
239
238
/// while the `tupled_upvars_ty`, representing the by-move version of the same
240
239
/// captures, will be `(String,)`.
241
240
pub coroutine_captures_by_ref_ty : I :: Ty ,
242
- /// Witness type returned by the generator produced by this coroutine-closure.
243
- pub coroutine_witness_ty : I :: Ty ,
244
241
}
245
242
246
243
impl < I : Interner > CoroutineClosureArgs < I > {
@@ -251,7 +248,6 @@ impl<I: Interner> CoroutineClosureArgs<I> {
251
248
parts. signature_parts_ty . into ( ) ,
252
249
parts. tupled_upvars_ty . into ( ) ,
253
250
parts. coroutine_captures_by_ref_ty . into ( ) ,
254
- parts. coroutine_witness_ty . into ( ) ,
255
251
] ) ) ,
256
252
}
257
253
}
@@ -292,7 +288,6 @@ impl<I: Interner> CoroutineClosureArgs<I> {
292
288
}
293
289
294
290
pub fn coroutine_closure_sig ( self ) -> ty:: Binder < I , CoroutineClosureSignature < I > > {
295
- let interior = self . coroutine_witness_ty ( ) ;
296
291
let ty:: FnPtr ( sig_tys, hdr) = self . signature_parts_ty ( ) . kind ( ) else { panic ! ( ) } ;
297
292
sig_tys. map_bound ( |sig_tys| {
298
293
let [ resume_ty, tupled_inputs_ty] = * sig_tys. inputs ( ) . as_slice ( ) else {
@@ -302,7 +297,6 @@ impl<I: Interner> CoroutineClosureArgs<I> {
302
297
panic ! ( )
303
298
} ;
304
299
CoroutineClosureSignature {
305
- interior,
306
300
tupled_inputs_ty,
307
301
resume_ty,
308
302
yield_ty,
@@ -318,10 +312,6 @@ impl<I: Interner> CoroutineClosureArgs<I> {
318
312
self . split ( ) . coroutine_captures_by_ref_ty
319
313
}
320
314
321
- pub fn coroutine_witness_ty ( self ) -> I :: Ty {
322
- self . split ( ) . coroutine_witness_ty
323
- }
324
-
325
315
pub fn has_self_borrows ( & self ) -> bool {
326
316
match self . coroutine_captures_by_ref_ty ( ) . kind ( ) {
327
317
ty:: FnPtr ( sig_tys, _) => sig_tys
@@ -361,7 +351,6 @@ impl<I: Interner> TypeVisitor<I> for HasRegionsBoundAt {
361
351
#[ derive_where( Clone , Copy , PartialEq , Eq , Hash , Debug ; I : Interner ) ]
362
352
#[ derive( TypeVisitable_Generic , TypeFoldable_Generic ) ]
363
353
pub struct CoroutineClosureSignature < I : Interner > {
364
- pub interior : I :: Ty ,
365
354
pub tupled_inputs_ty : I :: Ty ,
366
355
pub resume_ty : I :: Ty ,
367
356
pub yield_ty : I :: Ty ,
@@ -407,7 +396,6 @@ impl<I: Interner> CoroutineClosureSignature<I> {
407
396
resume_ty : self . resume_ty ,
408
397
yield_ty : self . yield_ty ,
409
398
return_ty : self . return_ty ,
410
- witness : self . interior ,
411
399
tupled_upvars_ty,
412
400
} ,
413
401
) ;
@@ -587,11 +575,6 @@ pub struct CoroutineArgsParts<I: Interner> {
587
575
pub yield_ty : I :: Ty ,
588
576
pub return_ty : I :: Ty ,
589
577
590
- /// The interior type of the coroutine.
591
- /// Represents all types that are stored in locals
592
- /// in the coroutine's body.
593
- pub witness : I :: Ty ,
594
-
595
578
/// The upvars captured by the closure. Remains an inference variable
596
579
/// until the upvar analysis, which happens late in HIR typeck.
597
580
pub tupled_upvars_ty : I :: Ty ,
@@ -607,7 +590,6 @@ impl<I: Interner> CoroutineArgs<I> {
607
590
parts. resume_ty . into ( ) ,
608
591
parts. yield_ty . into ( ) ,
609
592
parts. return_ty . into ( ) ,
610
- parts. witness . into ( ) ,
611
593
parts. tupled_upvars_ty . into ( ) ,
612
594
] ) ) ,
613
595
}
@@ -629,15 +611,6 @@ impl<I: Interner> CoroutineArgs<I> {
629
611
self . split ( ) . kind_ty
630
612
}
631
613
632
- /// This describes the types that can be contained in a coroutine.
633
- /// It will be a type variable initially and unified in the last stages of typeck of a body.
634
- /// It contains a tuple of all the types that could end up on a coroutine frame.
635
- /// The state transformation MIR pass may only produce layouts which mention types
636
- /// in this tuple. Upvars are not counted here.
637
- pub fn witness ( self ) -> I :: Ty {
638
- self . split ( ) . witness
639
- }
640
-
641
614
/// Returns an iterator over the list of types of captured paths by the coroutine.
642
615
/// In case there was a type error in figuring out the types of the captured path, an
643
616
/// empty iterator is returned.
0 commit comments