Add a few more comments
This commit is contained in:
parent
f1fef64e19
commit
541858ed78
3 changed files with 14 additions and 1 deletions
|
@ -1023,7 +1023,16 @@ fn build_construct_coroutine_by_move_shim<'tcx>(
|
|||
bug!();
|
||||
};
|
||||
|
||||
// We use `*mut Self` here because we only need to emit an ABI-compatible shim body,
|
||||
// rather than match the signature exactly.
|
||||
//
|
||||
// The self type here is a coroutine-closure, not a coroutine, and we never read from
|
||||
// it because it never has any captures, because this is only true in the Fn/FnMut
|
||||
// implementation, not the AsyncFn/AsyncFnMut implementation, which is implemented only
|
||||
// if the coroutine-closure has no captures.
|
||||
if receiver_by_ref {
|
||||
// Triple-check that there's no captures here.
|
||||
assert_eq!(args.as_coroutine_closure().tupled_upvars_ty(), tcx.types.unit);
|
||||
self_ty = Ty::new_mut_ptr(tcx, self_ty);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue