summaryrefslogtreecommitdiffstats
path: root/third_party/rust/extend/tests/compile_pass/issue_2.rs
blob: 76516486ab1f9877fac875b42ff70da4e7fbe668 (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
27
28
29
30
31
32
33
#![allow(unused_variables)]

use extend::ext;
use std::iter::FromIterator;

#[ext]
impl<T, K, F, C> C
where
    C: IntoIterator<Item = T>,
    K: Eq,
    F: Fn(&T) -> K,
{
    fn group_by<Out>(self, f: F) -> Out
    where
        Out: FromIterator<(K, Vec<T>)>,
    {
        todo!()
    }

    fn group_by_and_map_values<Out, G, T2>(self, f: F, g: G) -> Out
    where
        G: Fn(T) -> T2 + Copy,
        Out: FromIterator<(K, Vec<T2>)>,
    {
        todo!()
    }

    fn group_by_and_return_groups(self, f: F) -> Vec<Vec<T>> {
        todo!()
    }
}

fn main() {}