@@ -141,14 +141,6 @@ pub enum InstanceKind<'tcx> {
141141 receiver_by_ref : bool ,
142142 } ,
143143
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-
152144 /// Compiler-generated accessor for thread locals which returns a reference to the thread local
153145 /// the `DefId` defines. This is used to export thread locals from dylibs on platforms lacking
154146 /// native support.
@@ -248,7 +240,6 @@ impl<'tcx> InstanceKind<'tcx> {
248240 coroutine_closure_def_id : def_id,
249241 receiver_by_ref : _,
250242 }
251- | ty:: InstanceKind :: CoroutineKindShim { coroutine_def_id : def_id }
252243 | InstanceKind :: DropGlue ( def_id, _)
253244 | InstanceKind :: CloneShim ( def_id, _)
254245 | InstanceKind :: FnPtrAddrShim ( def_id, _)
@@ -270,7 +261,6 @@ impl<'tcx> InstanceKind<'tcx> {
270261 | InstanceKind :: Intrinsic ( ..)
271262 | InstanceKind :: ClosureOnceShim { .. }
272263 | ty:: InstanceKind :: ConstructCoroutineInClosureShim { .. }
273- | ty:: InstanceKind :: CoroutineKindShim { .. }
274264 | InstanceKind :: DropGlue ( ..)
275265 | InstanceKind :: AsyncDropGlueCtorShim ( ..)
276266 | InstanceKind :: CloneShim ( ..)
@@ -377,7 +367,6 @@ impl<'tcx> InstanceKind<'tcx> {
377367 | InstanceKind :: AsyncDropGlueCtorShim ( _, Some ( _) ) => false ,
378368 InstanceKind :: ClosureOnceShim { .. }
379369 | InstanceKind :: ConstructCoroutineInClosureShim { .. }
380- | InstanceKind :: CoroutineKindShim { .. }
381370 | InstanceKind :: DropGlue ( ..)
382371 | InstanceKind :: AsyncDropGlueCtorShim ( ..)
383372 | InstanceKind :: Item ( _)
@@ -452,7 +441,6 @@ pub fn fmt_instance(
452441 InstanceKind :: FnPtrShim ( _, ty) => write ! ( f, " - shim({ty})" ) ,
453442 InstanceKind :: ClosureOnceShim { .. } => write ! ( f, " - shim" ) ,
454443 InstanceKind :: ConstructCoroutineInClosureShim { .. } => write ! ( f, " - shim" ) ,
455- InstanceKind :: CoroutineKindShim { .. } => write ! ( f, " - shim" ) ,
456444 InstanceKind :: DropGlue ( _, None ) => write ! ( f, " - shim(None)" ) ,
457445 InstanceKind :: DropGlue ( _, Some ( ty) ) => write ! ( f, " - shim(Some({ty}))" ) ,
458446 InstanceKind :: CloneShim ( _, ty) => write ! ( f, " - shim({ty})" ) ,
@@ -850,7 +838,9 @@ impl<'tcx> Instance<'tcx> {
850838 Some ( Instance { def : ty:: InstanceKind :: Item ( coroutine_def_id) , args } )
851839 } else {
852840 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+ ) ,
854844 args,
855845 } )
856846 }
0 commit comments