rust/tests/ui/rfc-2632-const-trait-impl/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
258 B
Rust
Raw Normal View History

2021-08-28 10:53:26 -05:00
// check-pass
#![feature(const_trait_impl)]
#[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() {}