rust/tests/ui/traits/const-traits/item-bound-entailment.rs

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

31 lines
493 B
Rust
Raw Normal View History

2024-10-21 15:16:33 -05:00
//@ compile-flags: -Znext-solver
//@ check-pass
2024-10-30 13:03:44 -05:00
#![feature(const_trait_impl)]
2024-10-21 15:16:33 -05:00
#[const_trait] trait Foo {
type Assoc<T>: ~const Bar
where
T: ~const Bar;
}
#[const_trait] trait Bar {}
struct N<T>(T);
impl<T> Bar for N<T> where T: Bar {}
struct C<T>(T);
impl<T> const Bar for C<T> where T: ~const Bar {}
impl Foo for u32 {
type Assoc<T> = N<T>
where
T: Bar;
}
impl const Foo for i32 {
type Assoc<T> = C<T>
where
T: ~const Bar;
}
fn main() {}