@@ -141,14 +141,6 @@ pub enum InstanceKind<'tcx> {
141
141
receiver_by_ref : bool ,
142
142
} ,
143
143
144
- /// `<[coroutine] as Future>::poll`, but for coroutines produced when `AsyncFnOnce`
145
- /// is called on a coroutine-closure whose closure kind greater than `FnOnce`, or
146
- /// similarly for `AsyncFnMut`.
147
- ///
148
- /// This will select the body that is produced by the `ByMoveBody` transform, and thus
149
- /// take and use all of its upvars by-move rather than by-ref.
150
- CoroutineKindShim { coroutine_def_id : DefId } ,
151
-
152
144
/// Compiler-generated accessor for thread locals which returns a reference to the thread local
153
145
/// the `DefId` defines. This is used to export thread locals from dylibs on platforms lacking
154
146
/// native support.
@@ -248,7 +240,6 @@ impl<'tcx> InstanceKind<'tcx> {
248
240
coroutine_closure_def_id : def_id,
249
241
receiver_by_ref : _,
250
242
}
251
- | ty:: InstanceKind :: CoroutineKindShim { coroutine_def_id : def_id }
252
243
| InstanceKind :: DropGlue ( def_id, _)
253
244
| InstanceKind :: CloneShim ( def_id, _)
254
245
| InstanceKind :: FnPtrAddrShim ( def_id, _)
@@ -270,7 +261,6 @@ impl<'tcx> InstanceKind<'tcx> {
270
261
| InstanceKind :: Intrinsic ( ..)
271
262
| InstanceKind :: ClosureOnceShim { .. }
272
263
| ty:: InstanceKind :: ConstructCoroutineInClosureShim { .. }
273
- | ty:: InstanceKind :: CoroutineKindShim { .. }
274
264
| InstanceKind :: DropGlue ( ..)
275
265
| InstanceKind :: AsyncDropGlueCtorShim ( ..)
276
266
| InstanceKind :: CloneShim ( ..)
@@ -377,7 +367,6 @@ impl<'tcx> InstanceKind<'tcx> {
377
367
| InstanceKind :: AsyncDropGlueCtorShim ( _, Some ( _) ) => false ,
378
368
InstanceKind :: ClosureOnceShim { .. }
379
369
| InstanceKind :: ConstructCoroutineInClosureShim { .. }
380
- | InstanceKind :: CoroutineKindShim { .. }
381
370
| InstanceKind :: DropGlue ( ..)
382
371
| InstanceKind :: AsyncDropGlueCtorShim ( ..)
383
372
| InstanceKind :: Item ( _)
@@ -452,7 +441,6 @@ pub fn fmt_instance(
452
441
InstanceKind :: FnPtrShim ( _, ty) => write ! ( f, " - shim({ty})" ) ,
453
442
InstanceKind :: ClosureOnceShim { .. } => write ! ( f, " - shim" ) ,
454
443
InstanceKind :: ConstructCoroutineInClosureShim { .. } => write ! ( f, " - shim" ) ,
455
- InstanceKind :: CoroutineKindShim { .. } => write ! ( f, " - shim" ) ,
456
444
InstanceKind :: DropGlue ( _, None ) => write ! ( f, " - shim(None)" ) ,
457
445
InstanceKind :: DropGlue ( _, Some ( ty) ) => write ! ( f, " - shim(Some({ty}))" ) ,
458
446
InstanceKind :: CloneShim ( _, ty) => write ! ( f, " - shim({ty})" ) ,
@@ -850,7 +838,9 @@ impl<'tcx> Instance<'tcx> {
850
838
Some ( Instance { def : ty:: InstanceKind :: Item ( coroutine_def_id) , args } )
851
839
} else {
852
840
Some ( Instance {
853
- def : ty:: InstanceKind :: CoroutineKindShim { coroutine_def_id } ,
841
+ def : ty:: InstanceKind :: Item (
842
+ tcx. coroutine_by_move_body_def_id ( coroutine_def_id) ,
843
+ ) ,
854
844
args,
855
845
} )
856
846
}
0 commit comments