Subject: affects women just as often as men

From: 1 Step Hair-loss Cure <[email-masked]>
Date: Tue, 06 Jan 2015 11:29:40 -0800

At this moment you body could be turning testosterone into a steroid that is killing
hair on your body, says scientific research just released. 

As sufferers no, this ailment affects women just as much as men. 

Now that this steroid has been discovered, you can now see 
if your body is producing it and STOP producing it. 

Study Details > http://www.neverbebald.com/gantlet/pterodactyl/rousers/rewax/jockos/corkier.php 

Med-Info Systems 
http://www.neverbebald.com/pacemakers/trillion/registrar/gerrymandering/slash.htm  modify notifications - 115 Redby LN Clayton, TN 27527
ub struct Map<A, B, I: Iterator<A>, F: FnMut<(A,), B>> {
    // some fields omitted
}
I'm not sure how to return one of these from a function:

fn something<A: Clone, I: Iterator<A>>(iter: I) -> Map<A, (A,A), I, **what goes here**> {
    iter.map(|x| (x.clone(), x))
}
I've tried using the signature of the closure I'm using...

fn something<A: Clone, I: Iterator<A>>(iter: I) -> Map<A, (A,A), I, |A| -> (A,A)> {
    iter.map(|x| (x.clone(), x))
}
But then rust complains that I need an explicit lifetime bound. I'm not sure why I need this, but I add it anyway:

fn something<'a, A: Clone, I: Iterator<A>>(iter: I) -> Map<A, (A,A), I, |A|:'a -> (A,A)> {
    iter.map(|x| (x.clone(), x))
}
But then I get the error: the trait core::ops::Fn<(A,), (A, A)> is not implemented for the type 'a |A|:'a -> (A, A)

I haven't been able to progress any further, and at this point I'm just trying random things. Can someone help me understand how to use the new Map struct?

closures rust
share|improve this question
asked Dec 16 at 1:50

Durn Whippersnapper
38519
  	 	
Were you able to return a Map struct before this recent change?   Shepmaster Dec 16 at 2:35
  	 	
Yeah, fn something<'a, A, I: Iterator<A>>(input: I) -> Map<'a, A, (A, A), I> worked fine   Durn Whippersnapper Dec 16 at 2:43
You can't put anything meaningful in **what goes here**. The closure you define has a compiler-generated type that you can't name (that is, until abstract return types are implemented).