2024-08-07 12:36:41 -04:00
|
|
|
//@ edition: 2021
|
|
|
|
|
|
|
|
use std::pin::Pin;
|
|
|
|
use std::future::Future;
|
|
|
|
|
|
|
|
unsafe extern "Rust" {
|
|
|
|
pub unsafe fn unsafety() -> Pin<Box<dyn Future<Output = ()> + 'static>>;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" {
|
|
|
|
pub safe fn abi() -> Pin<Box<dyn Future<Output = ()> + 'static>>;
|
|
|
|
}
|
|
|
|
|
2024-11-04 18:59:57 +00:00
|
|
|
fn test(f: impl AsyncFn()) {}
|
2024-08-07 12:36:41 -04:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
test(unsafety); //~ ERROR the trait bound
|
|
|
|
test(abi); //~ ERROR the trait bound
|
|
|
|
}
|