diff options
| author | bors <bors@rust-lang.org> | 2017-01-01 05:39:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-01-01 05:39:16 +0000 |
| commit | 453172bdf93c11f3d0940a083cfcfd1ab0ccfa52 (patch) | |
| tree | b38b87d97a958f7847da0adc53c6b2b603c7e24d /src | |
| parent | 08babdb412a87960fe3602e92abf1bf5fe26a8da (diff) | |
| parent | c903210f680c3bc9974a5574c7689d4ee229a232 (diff) | |
| download | rust-453172bdf93c11f3d0940a083cfcfd1ab0ccfa52.tar.gz rust-453172bdf93c11f3d0940a083cfcfd1ab0ccfa52.zip | |
Auto merge of #38713 - clarcharr:trusted_len, r=brson
TrustedLen for Empty and Once. These implementations were missing, so, I went ahead and added them.
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/iter/sources.rs | 8 |
1 files changed, 7 insertions, 1 deletions
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<T> ExactSizeIterator for Empty<T> { } } +#[unstable(feature = "trusted_len", issue = "37572")] +unsafe impl<T> TrustedLen for Empty<T> {} + #[unstable(feature = "fused", issue = "35602")] impl<T> FusedIterator for Empty<T> {} @@ -216,6 +219,9 @@ impl<T> ExactSizeIterator for Once<T> { } } +#[unstable(feature = "trusted_len", issue = "37572")] +unsafe impl<T> TrustedLen for Once<T> {} + #[unstable(feature = "fused", issue = "35602")] impl<T> FusedIterator for Once<T> {} |
