]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2632-const-trait-impl/super-traits.rs
Auto merge of #100705 - compiler-errors:issue-100620, r=oli-obk
[rust.git] / src / test / ui / rfc-2632-const-trait-impl / super-traits.rs
1 // check-pass
2 #![feature(const_trait_impl)]
3
4 trait Foo {
5     fn a(&self);
6 }
7 trait Bar: ~const Foo {}
8
9 struct S;
10 impl const Foo for S {
11     fn a(&self) {}
12 }
13
14 impl const Bar for S {}
15
16 const fn foo<T: ~const Bar>(t: &T) {
17     t.a();
18 }
19
20 const _: () = foo(&S);
21
22 fn main() {}