summaryrefslogtreecommitdiffstats
path: root/src/test/ui/mir/remove-zsts-query-cycle.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/mir/remove-zsts-query-cycle.rs')
-rw-r--r--src/test/ui/mir/remove-zsts-query-cycle.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/mir/remove-zsts-query-cycle.rs b/src/test/ui/mir/remove-zsts-query-cycle.rs
new file mode 100644
index 000000000..be4d68f2d
--- /dev/null
+++ b/src/test/ui/mir/remove-zsts-query-cycle.rs
@@ -0,0 +1,16 @@
+// Regression test for #88972. Used to cause a query cycle:
+// optimized mir -> remove zsts -> layout of a generator -> optimized mir.
+//
+// edition:2018
+// compile-flags: --crate-type=lib -Zinline-mir=yes
+// build-pass
+
+pub async fn listen() -> Result<(), std::io::Error> {
+ let f = do_async();
+ std::mem::forget(f);
+ Ok(())
+}
+
+pub async fn do_async() {
+ listen().await.unwrap()
+}