]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/issue-24159.rs
Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyup
[rust.git] / src / test / ui / associated-types / issue-24159.rs
1 // check-pass
2
3 #![allow(unused)]
4
5 trait Bar<T> {
6     fn dummy(&self);
7 }
8
9 trait Foo {
10     type A;
11     type B: Bar<Self::A>;
12
13     fn get_b(&self) -> &Self::B;
14 }
15
16 fn test_bar<A, B: Bar<A>>(_: &B) {}
17
18 fn test<A, F: Foo<A = A>>(f: &F) {
19     test_bar(f.get_b());
20 }
21
22 trait Bar1<T> {}
23 trait Caz1 {
24     type A;
25     type B: Bar1<Self::A>;
26 }
27
28 fn test1<T, U>() where T: Caz1, U: Caz1<A = T::A> {}
29
30 trait Bar2<T> {}
31 trait Caz2 {
32     type A;
33     type B: Bar2<Self::A>;
34 }
35 fn test2<T: Caz2<A = ()>>() {}
36
37 fn main() {}