diff options
| author | Konrad Borowski <konrad@borowski.pw> | 2018-12-05 16:44:10 +0100 |
|---|---|---|
| committer | Konrad Borowski <konrad@borowski.pw> | 2018-12-05 16:48:34 +0100 |
| commit | 3eddc743f2ca3dbd5a5a41e3c2477ca9fbc7b97c (patch) | |
| tree | 678760776d0326c25c283e23f4b6d09feda6e7da | |
| parent | 21cb46a6e94906c2fdfda4df33c822ba28422b7f (diff) | |
| download | rust-3eddc743f2ca3dbd5a5a41e3c2477ca9fbc7b97c.tar.gz rust-3eddc743f2ca3dbd5a5a41e3c2477ca9fbc7b97c.zip | |
Use inner iterator may_have_side_effect for Cloned
Previous implementation wasn't correct, as an inner iterator could have had side effects.
| -rw-r--r-- | src/libcore/iter/mod.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs index 62e1f9fcb64..de7ab8843da 100644 --- a/src/libcore/iter/mod.rs +++ b/src/libcore/iter/mod.rs @@ -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")] |
