]>
Commit | Line | Data |
---|---|---|
9ffffee4 FG |
1 | // compile-flags: -Ztrait-solver=next |
2 | // check-pass | |
3 | ||
4 | trait Foo { | |
5 | type Assoc; | |
6 | } | |
7 | ||
8 | trait Bar {} | |
9 | ||
10 | impl<T> Foo for T { | |
11 | type Assoc = i32; | |
12 | } | |
13 | ||
14 | impl<T> Bar for T where T: Foo<Assoc = i32> {} | |
15 | ||
16 | fn require_bar<T: Bar>() {} | |
17 | ||
18 | fn foo<T: Foo>() { | |
19 | // Unlike the classic solver, `<T as Foo>::Assoc = _` will still project | |
20 | // down to `i32` even though there's a param-env candidate here, since we | |
21 | // don't assemble any param-env projection candidates for `T: Foo` alone. | |
22 | require_bar::<T>(); | |
23 | } | |
24 | ||
25 | fn main() {} |