summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/in-trait/issue-104678.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/async-await/in-trait/issue-104678.rs')
-rw-r--r--tests/ui/async-await/in-trait/issue-104678.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/ui/async-await/in-trait/issue-104678.rs b/tests/ui/async-await/in-trait/issue-104678.rs
new file mode 100644
index 000000000..e396df4e5
--- /dev/null
+++ b/tests/ui/async-await/in-trait/issue-104678.rs
@@ -0,0 +1,31 @@
+// edition:2021
+// check-pass
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+use std::future::Future;
+pub trait Pool {
+ type Conn;
+
+ async fn async_callback<'a, F: FnOnce(&'a Self::Conn) -> Fut, Fut: Future<Output = ()>>(
+ &'a self,
+ callback: F,
+ ) -> ();
+}
+
+pub struct PoolImpl;
+pub struct ConnImpl;
+
+impl Pool for PoolImpl {
+ type Conn = ConnImpl;
+
+ async fn async_callback<'a, F: FnOnce(&'a Self::Conn) -> Fut, Fut: Future<Output = ()>>(
+ &'a self,
+ _callback: F,
+ ) -> () {
+ todo!()
+ }
+}
+
+fn main() {}