2023-06-13 20:41:15 +00:00
|
|
|
//@ edition:2021
|
|
|
|
//@ run-rustfix
|
|
|
|
|
2024-02-07 10:42:01 +08:00
|
|
|
#![allow(dead_code)]
|
2023-06-13 20:41:15 +00:00
|
|
|
trait Trait {
|
2023-09-26 20:20:25 +00:00
|
|
|
#[allow(async_fn_in_trait)]
|
2023-06-13 20:41:15 +00:00
|
|
|
async fn foo();
|
|
|
|
|
2023-09-26 20:20:25 +00:00
|
|
|
#[allow(async_fn_in_trait)]
|
2023-06-13 20:41:15 +00:00
|
|
|
async fn bar() -> i32;
|
|
|
|
|
|
|
|
fn test(&self) -> impl Sized + '_;
|
2023-06-21 01:57:26 +00:00
|
|
|
|
2023-09-26 20:20:25 +00:00
|
|
|
#[allow(async_fn_in_trait)]
|
2023-06-21 01:57:26 +00:00
|
|
|
async fn baz(&self) -> &i32;
|
2023-06-13 20:41:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
2023-06-21 01:57:26 +00:00
|
|
|
impl Trait for S {async fn baz(&self) -> &i32 { todo!() }
|
|
|
|
fn test(&self) -> impl Sized + '_ { todo!() }
|
2023-06-13 20:41:15 +00:00
|
|
|
async fn bar() -> i32 { todo!() }
|
|
|
|
async fn foo() { todo!() }
|
|
|
|
}
|
|
|
|
//~^ ERROR not all trait items implemented
|
|
|
|
|
|
|
|
fn main() {}
|