summaryrefslogtreecommitdiffstats
path: root/src/test/mir-opt/inline/inline-async.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/mir-opt/inline/inline-async.rs')
-rw-r--r--src/test/mir-opt/inline/inline-async.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/mir-opt/inline/inline-async.rs b/src/test/mir-opt/inline/inline-async.rs
new file mode 100644
index 000000000..5c838159b
--- /dev/null
+++ b/src/test/mir-opt/inline/inline-async.rs
@@ -0,0 +1,18 @@
+// Checks that inliner doesn't introduce cycles when optimizing generators.
+// The outcome of optimization is not verfied, just the absence of the cycle.
+// Regression test for #76181.
+//
+// edition:2018
+
+#![crate_type = "lib"]
+
+pub struct S;
+
+impl S {
+ pub async fn g(&mut self) {
+ self.h();
+ }
+ pub fn h(&mut self) {
+ let _ = self.g();
+ }
+}