about summary refs log tree commit diff
path: root/tests/ui/async-await/async-closures/fn-exception.rs
blob: 36cb955cd5cccb7a63ff562ad76aaccb90ebd9e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//@ edition: 2021

#![feature(async_closure)]

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>>;
}

fn test(f: impl AsyncFn()) {}

fn main() {
    test(unsafety); //~ ERROR the trait bound
    test(abi); //~ ERROR the trait bound
}