about summary refs log tree commit diff
path: root/tests/ui/traits/const-traits/const-trait-async-assoc-fn.rs
blob: 00fdccc2ac8e43b26e1e4abeeb61cfb80b3a283e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//@ edition: 2021
#![feature(const_trait_impl)]

const trait Tr {
    async fn ft1() {}
//~^ ERROR async functions are not allowed in `const` traits
}

const trait Tr2 {
    fn f() -> impl std::future::Future<Output = ()>;
}

impl const Tr2 for () {
    async fn f() {}
//~^ ERROR async functions are not allowed in `const` trait impls
}

fn main() {}