]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/astconv-cycle-between-and-type.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / traits / astconv-cycle-between-and-type.rs
1 // run-pass
2 // Test that we are able to successfully compile a setup where a trait
3 // (`Trait1`) references a struct (`SomeType<u32>`) which in turn
4 // carries a predicate that references the trait (`u32 : Trait1`,
5 // substituted).
6
7 // pretty-expanded FIXME #23616
8
9 #![allow(dead_code)]
10
11 trait Trait1 : Trait2<SomeType<u32>> {
12     fn dumb(&self) { }
13 }
14
15 trait Trait2<A> {
16     fn dumber(&self, _: A) { }
17 }
18
19 struct SomeType<A>
20     where A : Trait1
21 {
22     a: A
23 }
24
25 impl Trait1 for u32 { }
26
27 impl Trait2<SomeType<u32>> for u32 { }
28
29 fn main() { }