Rollup merge of #119563 - compiler-errors:coroutine-resume, r=oli-obk
Check yield terminator's resume type in borrowck In borrowck, we didn't check that the lifetimes of the `TerminatorKind::Yield`'s `resume_place` were actually compatible with the coroutine's signature. That means that the lifetimes were totally going unchecked. Whoops! This PR implements this checking. Fixes #119564 r? types
This commit is contained in:
commit
ad7aabd965
12 changed files with 190 additions and 36 deletions
|
@ -1733,6 +1733,7 @@ impl<'tcx> MirPass<'tcx> for StateTransform {
|
|||
}
|
||||
|
||||
body.coroutine.as_mut().unwrap().yield_ty = None;
|
||||
body.coroutine.as_mut().unwrap().resume_ty = None;
|
||||
body.coroutine.as_mut().unwrap().coroutine_layout = Some(layout);
|
||||
|
||||
// Insert `drop(coroutine_struct)` which is used to drop upvars for coroutines in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue