2023-08-13 08:59:19 -05:00
|
|
|
// check-pass
|
2021-08-28 10:53:26 -05:00
|
|
|
|
2023-08-13 08:59:19 -05:00
|
|
|
#![feature(const_trait_impl, effects)]
|
2021-08-28 10:53:26 -05:00
|
|
|
|
2022-10-03 12:08:42 -05:00
|
|
|
#[const_trait]
|
2021-08-28 10:53:26 -05:00
|
|
|
trait Foo {
|
|
|
|
fn bar() where Self: ~const Foo;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl Foo for S {
|
|
|
|
fn bar() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn baz<T: Foo>() {
|
|
|
|
T::bar();
|
|
|
|
}
|
|
|
|
|
|
|
|
const fn qux<T: ~const Foo>() {
|
|
|
|
T::bar();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|