Proactively update coroutine drop shim's phase to account for later passes applied during shim query
This commit is contained in:
parent
9ffde4b089
commit
bc94c38d98
2 changed files with 26 additions and 0 deletions
19
tests/ui/async-await/post-cleanup-phase-validation.rs
Normal file
19
tests/ui/async-await/post-cleanup-phase-validation.rs
Normal file
|
@ -0,0 +1,19 @@
|
|||
//@ compile-flags: -Zvalidate-mir
|
||||
//@ edition: 2024
|
||||
//@ build-pass
|
||||
|
||||
// Regression test that we don't ICE when encountering a transmute in a coroutine's
|
||||
// drop shim body, which is conceptually in the Runtime phase but wasn't having the
|
||||
// phase updated b/c the pass manager neither optimizes nor updates the phase for
|
||||
// drop shim bodies.
|
||||
|
||||
struct HasDrop;
|
||||
impl Drop for HasDrop {
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
async {
|
||||
vec![async { HasDrop }.await];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue