rollup merge of #19827: japaric/clone-uc

closes #12677 (cc @Valloric)
cc #15294

r? @aturon / @alexcrichton

(Because of #19358 I had to move the struct bounds from the `where` clause into the parameter list)
This commit is contained in:
Alex Crichton
2014-12-17 08:34:06 -08:00
3 changed files with 152 additions and 0 deletions

View File

@@ -894,6 +894,17 @@ pub struct Splits<'a, T:'a, P> where P: FnMut(&T) -> bool {
finished: bool
}
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
impl<'a, T, P> Clone for Splits<'a, T, P> where P: Clone + FnMut(&T) -> bool {
fn clone(&self) -> Splits<'a, T, P> {
Splits {
v: self.v,
pred: self.pred.clone(),
finished: self.finished,
}
}
}
#[experimental = "needs review"]
impl<'a, T, P> Iterator<&'a [T]> for Splits<'a, T, P> where P: FnMut(&T) -> bool {
#[inline]