rust/tests/ui/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs

23 lines
264 B
Rust
Raw Normal View History

2021-09-03 10:37:57 +00:00
// check-pass
#![feature(const_trait_impl)]
struct S;
2022-08-28 06:27:31 +00:00
#[const_trait]
2021-09-03 10:37:57 +00:00
trait A {}
2022-08-28 06:27:31 +00:00
#[const_trait]
2021-09-03 10:37:57 +00:00
trait B {}
impl const A for S {}
impl const B for S {}
impl S {
const fn a<T: ~const A>() where T: ~const B {
}
}
const _: () = S::a::<S>();
fn main() {}