about summary refs log tree commit diff
path: root/tests/ui/traits/next-solver/gat-wf.rs
blob: cd4b96b3a58329745af805aff0b0061c1d61f1dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ 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() {}