We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
TrustedRandomAccess
iter::Fuse
1 parent 7ce1b3b commit 9989334Copy full SHA for 9989334
library/core/src/iter/adapters/fuse.rs
@@ -184,6 +184,11 @@ where
184
185
#[doc(hidden)]
186
#[unstable(feature = "trusted_random_access", issue = "none")]
187
+// SAFETY: `TrustedRandomAccess` requires that `size_hint()` must be exact and cheap to call, and
188
+// `Iterator::__iterator_get_unchecked()` must be implemented accordingly.
189
+//
190
+// This is safe to implement as `Fuse` is just forwarding these to the wrapped iterator `I`, which
191
+// preserves these properties.
192
unsafe impl<I> TrustedRandomAccess for Fuse<I>
193
where
194
I: TrustedRandomAccess,
0 commit comments