Rollup merge of #105692 - JohnTitor:issue-104678, r=compiler-errors
Add regression test for #104678 Closes #104678 r? `````@compiler-errors````` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
This commit is contained in:
commit
8111cc4610
31
src/test/ui/async-await/in-trait/issue-104678.rs
Normal file
31
src/test/ui/async-await/in-trait/issue-104678.rs
Normal file
@ -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() {}
|
Loading…
Reference in New Issue
Block a user