]> git.proxmox.com Git - rustc.git/blob - src/test/run-pass/issues/issue-25339.rs
New upstream version 1.37.0+dfsg1
[rustc.git] / src / test / run-pass / issues / issue-25339.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(unused_variables)]
4 #![feature(associated_type_defaults)]
5
6 use std::marker::PhantomData;
7
8 pub trait Routing<I> {
9 type Output;
10 fn resolve(&self, input: I);
11 }
12
13 pub trait ToRouting {
14 type Input;
15 type Routing : ?Sized = dyn Routing<Self::Input, Output=()>;
16 fn to_routing(self) -> Self::Routing;
17 }
18
19 pub struct Mount<I, R: Routing<I>> {
20 action: R,
21 _marker: PhantomData<I>
22 }
23
24 impl<I, R: Routing<I>> Mount<I, R> {
25 pub fn create<T: ToRouting<Routing=R>>(mount: &str, input: T) {
26 input.to_routing();
27 }
28 }
29
30 fn main() {
31 }