summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs
blob: dff8a244453af255528f1c6fd6b81e431790a9a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// known-bug: #110395

#![feature(const_trait_impl)]

#[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() {}