@@ -90,24 +90,20 @@ pub enum InstanceDef<'tcx> {
9090 /// and dispatch to the `FnMut::call_mut` instance for the closure.
9191 ClosureOnceShim { call_once : DefId , track_caller : bool } ,
9292
93- /// `<[FnMut/Fn coroutine-closure] as FnOnce>::call_once` or
94- /// `<[Fn coroutine-closure] as FnMut>::call_mut`.
93+ /// `<[FnMut/Fn coroutine-closure] as FnOnce>::call_once`
9594 ///
9695 /// The body generated here differs significantly from the `ClosureOnceShim`,
9796 /// since we need to generate a distinct coroutine type that will move the
9897 /// closure's upvars *out* of the closure.
99- ConstructCoroutineInClosureShim {
100- coroutine_closure_def_id : DefId ,
101- target_kind : ty:: ClosureKind ,
102- } ,
98+ ConstructCoroutineInClosureShim { coroutine_closure_def_id : DefId , receiver_by_ref : bool } ,
10399
104100 /// `<[coroutine] as Future>::poll`, but for coroutines produced when `AsyncFnOnce`
105101 /// is called on a coroutine-closure whose closure kind greater than `FnOnce`, or
106102 /// similarly for `AsyncFnMut`.
107103 ///
108104 /// This will select the body that is produced by the `ByMoveBody` transform, and thus
109105 /// take and use all of its upvars by-move rather than by-ref.
110- CoroutineKindShim { coroutine_def_id : DefId , target_kind : ty :: ClosureKind } ,
106+ CoroutineKindShim { coroutine_def_id : DefId } ,
111107
112108 /// Compiler-generated accessor for thread locals which returns a reference to the thread local
113109 /// the `DefId` defines. This is used to export thread locals from dylibs on platforms lacking
@@ -192,9 +188,9 @@ impl<'tcx> InstanceDef<'tcx> {
192188 | InstanceDef :: ClosureOnceShim { call_once : def_id, track_caller : _ }
193189 | ty:: InstanceDef :: ConstructCoroutineInClosureShim {
194190 coroutine_closure_def_id : def_id,
195- target_kind : _,
191+ receiver_by_ref : _,
196192 }
197- | ty:: InstanceDef :: CoroutineKindShim { coroutine_def_id : def_id, target_kind : _ }
193+ | ty:: InstanceDef :: CoroutineKindShim { coroutine_def_id : def_id }
198194 | InstanceDef :: DropGlue ( def_id, _)
199195 | InstanceDef :: CloneShim ( def_id, _)
200196 | InstanceDef :: FnPtrAddrShim ( def_id, _) => def_id,
@@ -651,10 +647,7 @@ impl<'tcx> Instance<'tcx> {
651647 Some ( Instance { def : ty:: InstanceDef :: Item ( coroutine_def_id) , args } )
652648 } else {
653649 Some ( Instance {
654- def : ty:: InstanceDef :: CoroutineKindShim {
655- coroutine_def_id,
656- target_kind : args. as_coroutine ( ) . kind_ty ( ) . to_opt_closure_kind ( ) . unwrap ( ) ,
657- } ,
650+ def : ty:: InstanceDef :: CoroutineKindShim { coroutine_def_id } ,
658651 args,
659652 } )
660653 }
0 commit comments