about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/async-await/in-trait/warn.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/ui/async-await/in-trait/warn.rs b/tests/ui/async-await/in-trait/warn.rs
index defbdcffccd..4f981c31f5c 100644
--- a/tests/ui/async-await/in-trait/warn.rs
+++ b/tests/ui/async-await/in-trait/warn.rs
@@ -3,9 +3,21 @@
 #![feature(async_fn_in_trait)]
 #![deny(async_fn_in_trait)]
 
-trait Foo {
+pub trait Foo {
     async fn not_send();
-    //~^ ERROR
+    //~^ ERROR  use of `async fn` in public traits is discouraged
+}
+
+mod private {
+    pub trait FooUnreachable {
+        async fn not_send();
+        // No warning
+    }
+}
+
+pub(crate) trait FooCrate {
+    async fn not_send();
+    // No warning
 }
 
 fn main() {}