about summary refs log tree commit diff
path: root/tests/ui/async-await/async-drop/async-without-sync.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/async-await/async-drop/async-without-sync.rs')
-rw-r--r--tests/ui/async-await/async-drop/async-without-sync.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/async-await/async-drop/async-without-sync.rs b/tests/ui/async-await/async-drop/async-without-sync.rs
new file mode 100644
index 00000000000..8a748636cc7
--- /dev/null
+++ b/tests/ui/async-await/async-drop/async-without-sync.rs
@@ -0,0 +1,19 @@
+//@ edition: 2024
+#![feature(async_drop)]
+#![allow(incomplete_features)]
+#![crate_type = "lib"]
+
+use std::future::AsyncDrop;
+use std::pin::Pin;
+
+async fn foo() {
+    let _st = St;
+}
+
+struct St;
+
+impl AsyncDrop for St { //~ ERROR: `AsyncDrop` impl without `Drop` impl
+    async fn drop(self: Pin<&mut Self>) {
+        println!("123");
+    }
+}