]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.rs
recover `const Tr` bounds (no `~`)
[rust.git] / src / test / ui / rfc-2632-const-trait-impl / trait-where-clause.rs
1 #![feature(const_trait_impl)]
2
3 trait Bar {}
4
5 trait Foo {
6     fn a();
7     fn b() where Self: ~const Bar;
8     fn c<T: ~const Bar>();
9 }
10
11 const fn test1<T: ~const Foo + Bar>() {
12     T::a();
13     T::b();
14     //~^ ERROR the trait bound
15     T::c::<T>();
16     //~^ ERROR the trait bound
17 }
18
19 const fn test2<T: ~const Foo + ~const Bar>() {
20     T::a();
21     T::b();
22     T::c::<T>();
23 }
24
25 fn test3<T: Foo>() {
26     T::a();
27     T::b();
28     //~^ ERROR the trait bound
29     T::c::<T>();
30     //~^ ERROR the trait bound
31 }
32
33 fn test4<T: Foo + Bar>() {
34     T::a();
35     T::b();
36     T::c::<T>();
37 }
38
39 fn main() {}