]> git.proxmox.com Git - rustc.git/blame - src/test/ui/traits/trait-object-bounds-cycle-4.rs
New upstream version 1.51.0+dfsg1
[rustc.git] / src / test / ui / traits / trait-object-bounds-cycle-4.rs
CommitLineData
29967ef6
XL
1// Check that we don't have a cycle when we try to normalize `Self::U` in the
2// bound below. Make sure that having a lifetime on the trait object doesn't break things
3
4// check-pass
5
6trait Is {
7 type T;
8}
9
10impl<U> Is for U {
11 type T = U;
12}
13
14trait Obj<'a> {
15 type U: Is<T = Self::V>;
16 type V;
17}
18
19fn is_obj<'a, T: ?Sized + Obj<'a>>(_: &T) {}
20
21fn f<'a>(x: &dyn Obj<'a, U = i32, V = i32>) {
22 is_obj(x)
23}
24
25fn main() {}