Fix FnMut/Fn shim for coroutine-closures that capture references
This commit is contained in:
parent
294436d273
commit
90143b0be8
18 changed files with 214 additions and 51 deletions
|
@ -127,9 +127,9 @@ 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 (mut) ref.
|
||||
// still take their receiver by ref.
|
||||
if receiver_by_ref {
|
||||
Ty::new_mut_ref(tcx, tcx.lifetimes.re_erased, coroutine_ty)
|
||||
Ty::new_imm_ref(tcx, tcx.lifetimes.re_erased, coroutine_ty)
|
||||
} else {
|
||||
coroutine_ty
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue