In ConstructCoroutineInClosureShim, pass receiver by ref, not pointer
This commit is contained in:
parent
536606bc5d
commit
22bc5c538d
8 changed files with 81 additions and 21 deletions
|
@ -125,8 +125,12 @@ fn fn_sig_for_fn_abi<'tcx>(
|
|||
coroutine_kind = ty::ClosureKind::FnOnce;
|
||||
|
||||
// Implementations of `FnMut` and `Fn` for coroutine-closures
|
||||
// still take their receiver by ref.
|
||||
if receiver_by_ref { Ty::new_mut_ptr(tcx, coroutine_ty) } else { coroutine_ty }
|
||||
// still take their receiver by (mut) ref.
|
||||
if receiver_by_ref {
|
||||
Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, coroutine_ty)
|
||||
} else {
|
||||
coroutine_ty
|
||||
}
|
||||
} else {
|
||||
tcx.closure_env_ty(coroutine_ty, coroutine_kind, env_region)
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue