diff options
| author | bors <bors@rust-lang.org> | 2021-07-22 12:29:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-22 12:29:30 +0000 |
| commit | 1158367a6d60d3e2a8c68d6212a8007992b1dbf0 (patch) | |
| tree | 6f92df24a03ad09f494a72e1be383c947e400568 /library/core/src/array | |
| parent | f913a4fe901d6aeb84941fa06c17916d4e6d1dd7 (diff) | |
| parent | ab9ea543f8637e0e01cef5e71d6e314999049b28 (diff) | |
| download | rust-1158367a6d60d3e2a8c68d6212a8007992b1dbf0.tar.gz rust-1158367a6d60d3e2a8c68d6212a8007992b1dbf0.zip | |
Auto merge of #87366 - GuillaumeGomez:rollup-7muueab, r=GuillaumeGomez
Rollup of 6 pull requests Successful merges: - #87270 (Don't display <table> in item summary) - #87281 (Normalize generic_ty before checking if bound is met) - #87288 (rustdoc: Restore --default-theme, etc, by restoring varname escaping) - #87307 (Allow combining -Cprofile-generate and -Cpanic=unwind when targeting MSVC.) - #87343 (Regression fix to avoid further beta backports: Remove unsound TrustedRandomAccess implementations) - #87357 (Update my name/email in .mailmap) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/core/src/array')
| -rw-r--r-- | library/core/src/array/iter.rs | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs index 931ea77eca4..61ab1b1faff 100644 --- a/library/core/src/array/iter.rs +++ b/library/core/src/array/iter.rs @@ -2,7 +2,7 @@ use crate::{ fmt, - iter::{self, ExactSizeIterator, FusedIterator, TrustedLen, TrustedRandomAccess}, + iter::{self, ExactSizeIterator, FusedIterator, TrustedLen}, mem::{self, MaybeUninit}, ops::Range, ptr, @@ -130,19 +130,6 @@ impl<T, const N: usize> Iterator for IntoIter<T, N> { fn last(mut self) -> Option<Self::Item> { self.next_back() } - - #[inline] - #[doc(hidden)] - unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item - where - Self: TrustedRandomAccess, - { - // SAFETY: Callers are only allowed to pass an index that is in bounds - // Additionally Self: TrustedRandomAccess is only implemented for T: Copy which means even - // multiple repeated reads of the same index would be safe and the - // values are !Drop, thus won't suffer from double drops. - unsafe { self.data.get_unchecked(self.alive.start + idx).assume_init_read() } - } } #[stable(feature = "array_value_iter_impls", since = "1.40.0")] @@ -197,17 +184,6 @@ impl<T, const N: usize> FusedIterator for IntoIter<T, N> {} #[stable(feature = "array_value_iter_impls", since = "1.40.0")] unsafe impl<T, const N: usize> TrustedLen for IntoIter<T, N> {} -#[doc(hidden)] -#[unstable(feature = "trusted_random_access", issue = "none")] -// T: Copy as approximation for !Drop since get_unchecked does not update the pointers -// and thus we can't implement drop-handling -unsafe impl<T, const N: usize> TrustedRandomAccess for IntoIter<T, N> -where - T: Copy, -{ - const MAY_HAVE_SIDE_EFFECT: bool = false; -} - #[stable(feature = "array_value_iter_impls", since = "1.40.0")] impl<T: Clone, const N: usize> Clone for IntoIter<T, N> { fn clone(&self) -> Self { |
