1
Fork 0

Use inner iterator may_have_side_effect for Cloned

Previous implementation wasn't correct, as an inner iterator
could have had side effects.
This commit is contained in:
Konrad Borowski 2018-12-05 16:44:10 +01:00
parent 21cb46a6e9
commit 3eddc743f2

View file

@ -602,7 +602,9 @@ unsafe impl<'a, I, T: 'a> TrustedRandomAccess for Cloned<I>
}
#[inline]
fn may_have_side_effect() -> bool { false }
fn may_have_side_effect() -> bool {
I::may_have_side_effect()
}
}
#[unstable(feature = "trusted_len", issue = "37572")]