]> git.lizzy.rs Git - rust.git/blob - tests/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs
Rollup merge of #106716 - c410-f3r:rfc-2397-1, r=davidtwco
[rust.git] / tests / ui / rfc-2632-const-trait-impl / non-const-op-in-closure-in-const.rs
1 // check-pass
2
3 #![feature(const_trait_impl)]
4
5 #[const_trait]
6 trait Convert<T> {
7     fn to(self) -> T;
8 }
9
10 impl<A, B> const Convert<B> for A where B: ~const From<A> {
11     fn to(self) -> B {
12         B::from(self)
13     }
14 }
15
16 const FOO: fn() -> String = || "foo".to();
17
18 fn main() {}