about summary refs log tree commit diff
path: root/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.rs
blob: d5f80acc15b54d8faef8abd720a3f97571acaa1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![feature(const_trait_impl, const_from)]

//@ check-pass

#[const_trait]
trait Convert<T> {
    fn to(self) -> T;
}

impl<A, B> const Convert<B> for A where B: [const] From<A> {
    fn to(self) -> B {
        B::from(self)
    }
}

const FOO: fn() -> String = || "foo".to();

fn main() {}