]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs
Rollup merge of #100872 - JanBeh:PR_vec_default_alloc_doc, r=fee1-dead
[rust.git] / src / test / 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 trait Convert<T> {
6     fn to(self) -> T;
7 }
8
9 impl<A, B> const Convert<B> for A where B: ~const From<A> {
10     fn to(self) -> B {
11         B::from(self)
12     }
13 }
14
15 const FOO: fn() -> String = || "foo".to();
16
17 fn main() {}