]> git.lizzy.rs Git - rust.git/blob - tests/ui/rfc-2632-const-trait-impl/super-traits.rs
Rollup merge of #106754 - compiler-errors:ty-infer-method-is-confusing, r=lcnr
[rust.git] / tests / ui / rfc-2632-const-trait-impl / super-traits.rs
1 // check-pass
2 #![feature(const_trait_impl)]
3
4 #[const_trait]
5 trait Foo {
6     fn a(&self);
7 }
8
9 #[const_trait]
10 trait Bar: ~const Foo {}
11
12 struct S;
13 impl const Foo for S {
14     fn a(&self) {}
15 }
16
17 impl const Bar for S {}
18
19 const fn foo<T: ~const Bar>(t: &T) {
20     t.a();
21 }
22
23 const _: () = foo(&S);
24
25 fn main() {}