This compiles:
fn isum<'a, I: Iterator<&'a int>>(mut it: I) -> int { it.fold(0, |a, b| a + *b) }This should be the same, but doesn't compile:
fn isum<I: Iterator<&int>>(mut it: I) -> int { it.fold(0, |a, b| a + *b)}The compiler complains of a "missing lifetime specifier" at the &int.