about summary refs log tree commit diff
path: root/tests/ui/async-await/in-trait/object-safety.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/async-await/in-trait/object-safety.rs')
-rw-r--r--tests/ui/async-await/in-trait/object-safety.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/async-await/in-trait/object-safety.rs b/tests/ui/async-await/in-trait/object-safety.rs
new file mode 100644
index 00000000000..a8bc35f7e0c
--- /dev/null
+++ b/tests/ui/async-await/in-trait/object-safety.rs
@@ -0,0 +1,13 @@
+// edition:2021
+
+#![feature(async_fn_in_trait)]
+//~^ WARN the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+
+trait Foo {
+    async fn foo(&self);
+}
+
+fn main() {
+    let x: &dyn Foo = todo!();
+    //~^ ERROR the trait `Foo` cannot be made into an object
+}