Skip to content

Commit 92720a6

Browse files
author
Lukas Markeffsky
committed
explain that PhantomData<&'a T> infers T: 'a
1 parent 20ac17a commit 92720a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/core/src/marker.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,14 +532,14 @@ impl<T: ?Sized> !Sync for *mut T {}
532532
/// use std::marker::PhantomData;
533533
///
534534
/// # #[allow(dead_code)]
535-
/// struct Slice<'a, T: 'a> {
535+
/// struct Slice<'a, T> {
536536
/// start: *const T,
537537
/// end: *const T,
538538
/// phantom: PhantomData<&'a T>,
539539
/// }
540540
/// ```
541541
///
542-
/// This also in turn requires the annotation `T: 'a`, indicating
542+
/// This also in turn infers the lifetime bound `T: 'a`, indicating
543543
/// that any references in `T` are valid over the lifetime `'a`.
544544
///
545545
/// When initializing a `Slice` you simply provide the value
@@ -548,7 +548,7 @@ impl<T: ?Sized> !Sync for *mut T {}
548548
/// ```
549549
/// # #![allow(dead_code)]
550550
/// # use std::marker::PhantomData;
551-
/// # struct Slice<'a, T: 'a> {
551+
/// # struct Slice<'a, T> {
552552
/// # start: *const T,
553553
/// # end: *const T,
554554
/// # phantom: PhantomData<&'a T>,

0 commit comments

Comments
 (0)