]> git.lizzy.rs Git - rust.git/blob - src/test/ui/polymorphization/normalized_sig_types.rs
Rollup merge of #87440 - twetzel59:fix-barrier-no-op, r=yaahc
[rust.git] / src / test / ui / polymorphization / normalized_sig_types.rs
1 // build-pass
2 // compile-flags:-Zpolymorphize=on
3
4 pub trait ParallelIterator: Sized {
5     fn drive<C: Consumer<()>>(_: C) {
6         C::into_folder();
7     }
8 }
9
10 pub trait Consumer<T>: Sized {
11     type Result;
12     fn into_folder() -> Self::Result;
13 }
14
15 impl ParallelIterator for () {}
16
17 impl<F: Fn(), T> Consumer<T> for F {
18     type Result = ();
19     fn into_folder() -> Self::Result {
20         unimplemented!()
21     }
22 }
23
24 fn main() {
25     <()>::drive(|| ());
26 }