]> git.proxmox.com Git - rustc.git/blob - src/test/ui/associated-types/issue-24204.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / associated-types / issue-24204.rs
1 // check-pass
2
3 #![allow(dead_code)]
4
5 trait MultiDispatch<T> {
6 type O;
7 }
8
9 trait Trait: Sized {
10 type A: MultiDispatch<Self::B, O = Self>;
11 type B;
12
13 fn new<U>(u: U) -> <Self::A as MultiDispatch<U>>::O
14 where
15 Self::A: MultiDispatch<U>;
16 }
17
18 fn test<T: Trait<B = i32>>(b: i32) -> T
19 where
20 T::A: MultiDispatch<i32>,
21 {
22 T::new(b)
23 }
24
25 fn main() {}