use iter::BaseIter; trait FlatMapToVec { fn flat_map_to_vec>(op: fn(A) -> IB) -> ~[B]; } impl BaseIter: FlatMapToVec { fn flat_map_to_vec>(op: fn(A) -> IB) -> ~[B] { iter::flat_map_to_vec(self, op) } } fn main() {}