2021-08-28 02:37:30 -05:00
|
|
|
#![feature(const_trait_impl)]
|
|
|
|
|
2022-10-03 12:08:42 -05:00
|
|
|
#[const_trait]
|
2021-08-28 02:37:30 -05:00
|
|
|
trait Bar {}
|
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
fn a();
|
|
|
|
fn b() where Self: ~const Bar;
|
2021-08-28 10:53:26 -05:00
|
|
|
fn c<T: ~const Bar>();
|
2021-08-28 02:37:30 -05:00
|
|
|
}
|
|
|
|
|
2022-09-10 01:37:26 -05:00
|
|
|
fn test1<T: Foo>() {
|
2021-08-28 02:37:30 -05:00
|
|
|
T::a();
|
|
|
|
T::b();
|
|
|
|
//~^ ERROR the trait bound
|
2021-08-28 10:53:26 -05:00
|
|
|
T::c::<T>();
|
|
|
|
//~^ ERROR the trait bound
|
2021-08-28 02:37:30 -05:00
|
|
|
}
|
|
|
|
|
2022-09-10 01:37:26 -05:00
|
|
|
fn test2<T: Foo + Bar>() {
|
2021-08-28 02:37:30 -05:00
|
|
|
T::a();
|
|
|
|
T::b();
|
2021-08-28 10:53:26 -05:00
|
|
|
T::c::<T>();
|
2021-08-28 02:37:30 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|