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

23 lines
264 B
Rust
Raw Normal View History

2021-09-03 05:37:57 -05:00
// check-pass
#![feature(const_trait_impl)]
struct S;
2022-08-28 01:27:31 -05:00
#[const_trait]
2021-09-03 05:37:57 -05:00
trait A {}
2022-08-28 01:27:31 -05:00
#[const_trait]
2021-09-03 05:37:57 -05: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() {}