Rollup merge of #120330 - compiler-errors:no-coroutine-info-in-coroutine-drop-body, r=nnethercote
Remove coroutine info when building coroutine drop body Coroutine drop shims are not themselves coroutines, so erase the "`coroutine`" field from the body so that helper fns like `yield_ty` and `coroutine_kind` properly return `None` for the drop shim.
This commit is contained in:
commit
4bca954634
4 changed files with 21 additions and 47 deletions
|
@ -1231,7 +1231,12 @@ fn create_coroutine_drop_shim<'tcx>(
|
|||
drop_clean: BasicBlock,
|
||||
) -> Body<'tcx> {
|
||||
let mut body = body.clone();
|
||||
body.arg_count = 1; // make sure the resume argument is not included here
|
||||
// Take the coroutine info out of the body, since the drop shim is
|
||||
// not a coroutine body itself; it just has its drop built out of it.
|
||||
let _ = body.coroutine.take();
|
||||
// Make sure the resume argument is not included here, since we're
|
||||
// building a body for `drop_in_place`.
|
||||
body.arg_count = 1;
|
||||
|
||||
let source_info = SourceInfo::outermost(body.span);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue