Skip to content

Commit

Permalink
Rollup merge of rust-lang#105692 - JohnTitor:issue-104678, r=compiler…
Browse files Browse the repository at this point in the history
…-errors

Add regression test for rust-lang#104678

Closes rust-lang#104678
r? ``@compiler-errors``

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
  • Loading branch information
matthiaskrgr authored Dec 14, 2022
2 parents 1fcd973 + 687b4d9 commit e657bbc
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 e657bbc

Please sign in to comment.