diff --git a/src/libcore/iter/sources.rs b/src/libcore/iter/sources.rs index da346eaf1db..b988ce73bde 100644 --- a/src/libcore/iter/sources.rs +++ b/src/libcore/iter/sources.rs @@ -12,7 +12,7 @@ use fmt; use marker; use usize; -use super::FusedIterator; +use super::{FusedIterator, TrustedLen}; /// An iterator that repeats an element endlessly. /// @@ -138,6 +138,9 @@ impl ExactSizeIterator for Empty { } } +#[unstable(feature = "trusted_len", issue = "37572")] +unsafe impl TrustedLen for Empty {} + #[unstable(feature = "fused", issue = "35602")] impl FusedIterator for Empty {} @@ -216,6 +219,9 @@ impl ExactSizeIterator for Once { } } +#[unstable(feature = "trusted_len", issue = "37572")] +unsafe impl TrustedLen for Once {} + #[unstable(feature = "fused", issue = "35602")] impl FusedIterator for Once {}