granite-rust/tests/ui/traits/const-traits/trait-where-clause-self-referential.rs
2024-11-03 18:59:31 +00:00

24 lines
291 B
Rust

//@ check-pass
//@ compile-flags: -Znext-solver
#![feature(const_trait_impl)]
#[const_trait]
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() {}