@@ -556,21 +556,21 @@ impl<A: Debug + TrustedRandomAccessNoCoerce, B: Debug + TrustedRandomAccessNoCoe
556
556
/// * `std::iter::ExactSizeIterator::len`
557
557
/// * `std::iter::Iterator::__iterator_get_unchecked`
558
558
/// * `std::iter::TrustedRandomAccessNoCoerce::size`
559
- /// 5. If `T ` is a subtype of `Self `, then `self` is allowed to be coerced
559
+ /// 5. If `Self ` is a subtype of `T `, then `self` is allowed to be coerced
560
560
/// to `T`. If `self` is coerced to `T` after `self.__iterator_get_unchecked(idx)` has already
561
561
/// been called, then no methods except for the ones listed under 4. are allowed to be called
562
562
/// on the resulting value of type `T`, either. Multiple such coercion steps are allowed.
563
563
/// Regarding 2. and 3., the number of times `__iterator_get_unchecked(idx)` or `next_back()` is
564
564
/// called on `self` and the resulting value of type `T` (and on further coercion results with
565
- /// sub-subtypes ) are added together and their sums must not exceed the specified bounds.
565
+ /// super-supertypes ) are added together and their sums must not exceed the specified bounds.
566
566
///
567
567
/// Further, given that these conditions are met, it must guarantee that:
568
568
///
569
569
/// * It does not change the value returned from `size_hint`
570
570
/// * It must be safe to call the methods listed above on `self` after calling
571
571
/// `self.__iterator_get_unchecked(idx)`, assuming that the required traits are implemented.
572
572
/// * It must also be safe to drop `self` after calling `self.__iterator_get_unchecked(idx)`.
573
- /// * If `T ` is a subtype of `Self `, then it must be safe to coerce `self` to `T`.
573
+ /// * If `Self ` is a subtype of `T `, then it must be safe to coerce `self` to `T`.
574
574
//
575
575
// FIXME: Clarify interaction with SourceIter/InPlaceIterable. Calling `SourceIter::as_inner`
576
576
// after `__iterator_get_unchecked` is supposed to be allowed.
@@ -580,7 +580,7 @@ impl<A: Debug + TrustedRandomAccessNoCoerce, B: Debug + TrustedRandomAccessNoCoe
580
580
pub unsafe trait TrustedRandomAccess : TrustedRandomAccessNoCoerce { }
581
581
582
582
/// Like [`TrustedRandomAccess`] but without any of the requirements / guarantees around
583
- /// coercions to subtypes after `__iterator_get_unchecked` (they aren’t allowed here!), and
583
+ /// coercions to supertypes after `__iterator_get_unchecked` (they aren’t allowed here!), and
584
584
/// without the requirement that subtypes / supertypes implement `TrustedRandomAccessNoCoerce`.
585
585
///
586
586
/// This trait was created in PR #85874 to fix soundness issue #85873 without performance regressions.
0 commit comments