mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 20:23:59 +00:00
34 lines
672 B
Rust
34 lines
672 B
Rust
// edition:2021
|
|
// check-pass
|
|
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
|
|
// revisions: current next
|
|
|
|
#![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() {}
|