2023-09-26 15:20:21 -05:00
|
|
|
// edition: 2021
|
|
|
|
|
|
|
|
#![feature(async_fn_in_trait)]
|
|
|
|
#![deny(async_fn_in_trait)]
|
|
|
|
|
2023-09-30 14:28:40 -05:00
|
|
|
pub trait Foo {
|
2023-09-26 15:20:21 -05:00
|
|
|
async fn not_send();
|
2023-09-30 14:28:40 -05:00
|
|
|
//~^ ERROR use of `async fn` in public traits is discouraged
|
|
|
|
}
|
|
|
|
|
|
|
|
mod private {
|
|
|
|
pub trait FooUnreachable {
|
|
|
|
async fn not_send();
|
|
|
|
// No warning
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub(crate) trait FooCrate {
|
|
|
|
async fn not_send();
|
|
|
|
// No warning
|
2023-09-26 15:20:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|