Add SAFETY comment for the TrustedRandomAccess impl of iter::Fuse
This commit is contained in:
parent
7ce1b3b244
commit
99893346e8
1 changed files with 5 additions and 0 deletions
|
|
@ -184,6 +184,11 @@ where
|
|||
|
||||
#[doc(hidden)]
|
||||
#[unstable(feature = "trusted_random_access", issue = "none")]
|
||||
// SAFETY: `TrustedRandomAccess` requires that `size_hint()` must be exact and cheap to call, and
|
||||
// `Iterator::__iterator_get_unchecked()` must be implemented accordingly.
|
||||
//
|
||||
// This is safe to implement as `Fuse` is just forwarding these to the wrapped iterator `I`, which
|
||||
// preserves these properties.
|
||||
unsafe impl<I> TrustedRandomAccess for Fuse<I>
|
||||
where
|
||||
I: TrustedRandomAccess,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue