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

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

31 lines
620 B
Rust
Raw Normal View History

2024-10-21 20:16:33 +00:00
//@ compile-flags: -Znext-solver
2024-10-30 18:03:44 +00:00
#![feature(const_trait_impl)]
2024-10-21 20:16:33 +00:00
#[const_trait] trait Foo {
type Assoc<T>: [const] Bar
2024-10-21 20:16:33 +00:00
where
T: [const] Bar;
2024-10-21 20:16:33 +00:00
}
#[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 {}
2024-10-21 20:16:33 +00:00
impl const Foo for u32 {
type Assoc<T> = N<T>
//~^ ERROR the trait bound `N<T>: [const] Bar` is not satisfied
2024-10-21 20:16:33 +00:00
where
T: [const] Bar;
2024-10-21 20:16:33 +00:00
}
impl const Foo for i32 {
type Assoc<T> = C<T>
//~^ ERROR the trait bound `T: [const] Bar` is not satisfied
2024-10-21 20:16:33 +00:00
where
T: Bar;
}
fn main() {}