]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/object/bounds-cycle-1.rs
Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into sync_cg_clif-2022-10-23
[rust.git] / src / test / ui / traits / object / bounds-cycle-1.rs
1 // Check that we don't have a cycle when we try to normalize `Self::U` in the
2 // bound below.
3
4 // check-pass
5
6 trait Is {
7     type T;
8 }
9
10 impl<U> Is for U {
11     type T = U;
12 }
13
14 trait Obj {
15     type U: Is<T = Self::U>;
16 }
17
18 fn is_obj<T: ?Sized + Obj>(_: &T) {}
19
20 fn f(x: &dyn Obj<U = i32>) {
21     is_obj(x)
22 }
23
24 fn main() {}