]>
Commit | Line | Data |
---|---|---|
29967ef6 XL |
1 | // Check that we validate associated type bounds on super traits for trait |
2 | // objects | |
3 | ||
4 | trait Is { | |
5 | type T; | |
6 | } | |
7 | ||
8 | impl<U> Is for U { | |
9 | type T = U; | |
10 | } | |
11 | ||
12 | trait Super { | |
13 | type V; | |
14 | } | |
15 | ||
16 | trait Obj: Super { | |
17 | type U: Is<T = Self::V>; | |
18 | } | |
19 | ||
20 | fn is_obj<T: ?Sized + Obj>(_: &T) {} | |
21 | ||
22 | fn f(x: &dyn Obj<U = i32, V = i64>) { | |
23 | is_obj(x) | |
24 | //~^ type mismatch resolving `<i32 as Is>::T == i64` | |
25 | } | |
26 | ||
27 | fn main() {} |