]> git.lizzy.rs Git - rust.git/blob - tests/ui/associated-types/issue-24204.rs
Rollup merge of #107531 - GuillaumeGomez:inline-images-in-css, r=notriddle
[rust.git] / tests / 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() {}