summaryrefslogtreecommitdiffstats
path: root/src/test/ui/polymorphization/normalized_sig_types.rs
blob: d732b1071d8a94830543dfde91f7fbbd82932dd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// build-pass
// compile-flags:-Zpolymorphize=on

pub trait ParallelIterator: Sized {
    fn drive<C: Consumer<()>>(_: C) {
        C::into_folder();
    }
}

pub trait Consumer<T>: Sized {
    type Result;
    fn into_folder() -> Self::Result;
}

impl ParallelIterator for () {}

impl<F: Fn(), T> Consumer<T> for F {
    type Result = ();
    fn into_folder() -> Self::Result {
        unimplemented!()
    }
}

fn main() {
    <()>::drive(|| ());
}