Files
rust/tests/ui/traits/next-solver/gat-wf.rs
2025-04-08 23:06:31 +03:00

17 lines
498 B
Rust

//@ compile-flags: -Znext-solver
// Make sure that, like the old trait solver, we end up requiring that the WC of
// impl GAT matches that of the trait. This is not a restriction that we *need*,
// but is a side-effect of registering the where clauses when normalizing the GAT
// when proving it satisfies its item bounds.
trait Foo {
type T<'a>: Sized where Self: 'a;
}
impl Foo for &() {
type T<'a> = (); //~ ERROR the type `&()` does not fulfill the required lifetime
}
fn main() {}