granite-rust/tests/ui/traits/const-traits/trait-where-clause-self-referential.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
291 B
Rust
Raw Normal View History

//@ check-pass
2024-06-30 17:08:45 +00:00
//@ compile-flags: -Znext-solver
2024-10-30 18:03:44 +00:00
#![feature(const_trait_impl)]
2021-08-28 15:53:26 +00:00
#[const_trait]
2021-08-28 15:53:26 +00: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() {}