Skip to content

Commit

Permalink
Add regression test for #104678
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
  • Loading branch information
JohnTitor committed Dec 14, 2022
1 parent 918d0ac commit 687b4d9
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/test/ui/async-await/in-trait/issue-104678.rs
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit 687b4d9

Please sign in to comment.