about summary refs log tree commit diff
path: root/tests/ui/force-inlining
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-01-27 19:15:37 +0000
committerMichael Goulet <michael@errs.io>2025-02-05 18:36:17 +0000
commitd0b0b028a68eaee609b235a8cb5627466b2d79fb (patch)
tree1a0be7516e96bf237facaae82c9ed5a3ef96df86 /tests/ui/force-inlining
parent820bfffc25fee9866aa8176529091e04b8824f09 (diff)
downloadrust-d0b0b028a68eaee609b235a8cb5627466b2d79fb.tar.gz
rust-d0b0b028a68eaee609b235a8cb5627466b2d79fb.zip
Eagerly detect coroutine recursion pre-mono when possible
Diffstat (limited to 'tests/ui/force-inlining')
-rw-r--r--tests/ui/force-inlining/deny-async.rs4
-rw-r--r--tests/ui/force-inlining/deny-async.stderr19
2 files changed, 21 insertions, 2 deletions
diff --git a/tests/ui/force-inlining/deny-async.rs b/tests/ui/force-inlining/deny-async.rs
index bdf6271bd2a..7c95a53c26f 100644
--- a/tests/ui/force-inlining/deny-async.rs
+++ b/tests/ui/force-inlining/deny-async.rs
@@ -1,6 +1,6 @@
-//@ check-fail
 //@ compile-flags: --crate-type=lib
 //@ edition: 2021
+
 #![allow(internal_features)]
 #![feature(rustc_attrs)]
 
@@ -20,5 +20,7 @@ pub fn callee_justified() {
 
 async fn async_caller() {
     callee();
+    //~^ ERROR `callee` could not be inlined
     callee_justified();
+    //~^ ERROR `callee_justified` could not be inlined
 }
diff --git a/tests/ui/force-inlining/deny-async.stderr b/tests/ui/force-inlining/deny-async.stderr
index 302ca419071..d6516ed875c 100644
--- a/tests/ui/force-inlining/deny-async.stderr
+++ b/tests/ui/force-inlining/deny-async.stderr
@@ -20,5 +20,22 @@ LL | pub fn callee_justified() {
    |
    = note: incompatible due to: #[rustc_no_mir_inline]
 
-error: aborting due to 2 previous errors
+error: `callee` could not be inlined into `async_caller::{closure#0}` but is required to be inlined
+  --> $DIR/deny-async.rs:22:5
+   |
+LL |     callee();
+   |     ^^^^^^^^ ...`callee` called here
+   |
+   = note: could not be inlined due to: #[rustc_no_mir_inline]
+
+error: `callee_justified` could not be inlined into `async_caller::{closure#0}` but is required to be inlined
+  --> $DIR/deny-async.rs:24:5
+   |
+LL |     callee_justified();
+   |     ^^^^^^^^^^^^^^^^^^ ...`callee_justified` called here
+   |
+   = note: could not be inlined due to: #[rustc_no_mir_inline]
+   = note: `callee_justified` is required to be inlined to: the test requires it
+
+error: aborting due to 4 previous errors