about summary refs log tree commit diff
path: root/library/alloc/src/collections/binary_heap
diff options
context:
space:
mode:
authorThe 8472 <git@infinite-source.de>2023-04-15 12:59:16 +0200
committerThe 8472 <git@infinite-source.de>2023-09-03 19:59:47 +0200
commit3ca6bb0b44c3e65dab07e12aec9efb277dc206f9 (patch)
treeb5be981314a0c22721924dfe8eea614151f226e7 /library/alloc/src/collections/binary_heap
parent2a1af898b2cb535a45cefe67acf9d023eff16b27 (diff)
downloadrust-3ca6bb0b44c3e65dab07e12aec9efb277dc206f9.tar.gz
rust-3ca6bb0b44c3e65dab07e12aec9efb277dc206f9.zip
Expand in-place iteration specialization to Flatten, FlatMap and ArrayChunks
Diffstat (limited to 'library/alloc/src/collections/binary_heap')
-rw-r--r--library/alloc/src/collections/binary_heap/mod.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/library/alloc/src/collections/binary_heap/mod.rs b/library/alloc/src/collections/binary_heap/mod.rs
index 66573b90db9..ad2c4e483a3 100644
--- a/library/alloc/src/collections/binary_heap/mod.rs
+++ b/library/alloc/src/collections/binary_heap/mod.rs
@@ -145,7 +145,7 @@
 
 use core::alloc::Allocator;
 use core::fmt;
-use core::iter::{FusedIterator, InPlaceIterable, SourceIter, TrustedLen};
+use core::iter::{FusedIterator, InPlaceIterable, SourceIter, TrustedFused, TrustedLen};
 use core::mem::{self, swap, ManuallyDrop};
 use core::num::NonZeroUsize;
 use core::ops::{Deref, DerefMut};
@@ -1540,6 +1540,10 @@ impl<T, A: Allocator> ExactSizeIterator for IntoIter<T, A> {
 #[stable(feature = "fused", since = "1.26.0")]
 impl<T, A: Allocator> FusedIterator for IntoIter<T, A> {}
 
+#[doc(hidden)]
+#[unstable(issue = "none", feature = "trusted_fused")]
+unsafe impl<T, A: Allocator> TrustedFused for IntoIter<T, A> {}
+
 #[stable(feature = "default_iters", since = "1.70.0")]
 impl<T> Default for IntoIter<T> {
     /// Creates an empty `binary_heap::IntoIter`.
@@ -1569,7 +1573,10 @@ unsafe impl<T, A: Allocator> SourceIter for IntoIter<T, A> {
 
 #[unstable(issue = "none", feature = "inplace_iteration")]
 #[doc(hidden)]
-unsafe impl<I, A: Allocator> InPlaceIterable for IntoIter<I, A> {}
+unsafe impl<I, A: Allocator> InPlaceIterable for IntoIter<I, A> {
+    const EXPAND_BY: Option<NonZeroUsize> = NonZeroUsize::new(1);
+    const MERGE_BY: Option<NonZeroUsize> = NonZeroUsize::new(1);
+}
 
 unsafe impl<I> AsVecIntoIter for IntoIter<I> {
     type Item = I;