Skip to content

Commit def863d

Browse files
committed
tweaks and typos
1 parent 7370540 commit def863d

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

library/core/src/ptr/const_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl<T: ?Sized> *const T {
185185
}
186186

187187
/// Gets the "address" portion of the pointer, and 'exposes' the "provenance" part for future
188-
/// use in pointer-to-integer casts.
188+
/// use in [`from_exposed_addr`][].
189189
///
190190
/// This is equivalent to `self as usize`, which semantically discards *provenance* and
191191
/// *address-space* information. Furthermore, this (like the `as` cast) has the implicit

library/core/src/ptr/mod.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -587,15 +587,15 @@ pub const fn invalid_mut<T>(addr: usize) -> *mut T {
587587

588588
/// Convert an address back to a pointer, picking up a previously 'exposed' provenance.
589589
///
590-
/// This is equivalent to `addr as ptr`. The provenance of the returned pointer is that of *any*
591-
/// pointer that was previously passed to [`expose_addr`][pointer::expose_addr]. If there is no
592-
/// previously 'exposed' provenance that justifies the way this pointer will be used, the
593-
/// program has undefined behavior. Note that there is no algorithm that decides which
594-
/// provenance will be used. You can think of this as "guessing" the right provenance, and the
595-
/// guess will be "maximally in your favor", in the sense that if there is any way to avoid
596-
/// undefined behavior, then that is the guess that will be taken.
597-
///
598-
/// On platforms with multiple address spaces, it is your responsibility to ensure the the
590+
/// This is equivalent to `addr as *const T`. The provenance of the returned pointer is that of *any*
591+
/// pointer that was previously passed to [`expose_addr`][pointer::expose_addr] or a `ptr as usize`
592+
/// cast. If there is no previously 'exposed' provenance that justifies the way this pointer will be
593+
/// used, the program has undefined behavior. Note that there is no algorithm that decides which
594+
/// provenance will be used. You can think of this as "guessing" the right provenance, and the guess
595+
/// will be "maximally in your favor", in the sense that if there is any way to avoid undefined
596+
/// behavior, then that is the guess that will be taken.
597+
///
598+
/// On platforms with multiple address spaces, it is your responsibility to ensure that the
599599
/// address makes sense in the address space that this pointer will be used with.
600600
///
601601
/// Using this method means that code is *not* following strict provenance rules. "Guessing" a
@@ -623,15 +623,15 @@ where
623623

624624
/// Convert an address back to a mutable pointer, picking up a previously 'exposed' provenance.
625625
///
626-
/// This is equivalent to `addr as ptr`. The provenance of the returned pointer is that of *any*
627-
/// pointer that was previously passed to [`expose_addr`][pointer::expose_addr]. If there is no
628-
/// previously 'exposed' provenance that justifies the way this pointer will be used, the
629-
/// program has undefined behavior. Note that there is no algorithm that decides which
630-
/// provenance will be used. You can think of this as "guessing" the right provenance, and the
631-
/// guess will be "maximally in your favor", in the sense that if there is any way to avoid
632-
/// undefined behavior, then that is the guess that will be taken.
626+
/// This is equivalent to `addr as *mut T`. The provenance of the returned pointer is that of *any*
627+
/// pointer that was previously passed to [`expose_addr`][pointer::expose_addr] or a `ptr as usize`
628+
/// cast. If there is no previously 'exposed' provenance that justifies the way this pointer will be
629+
/// used, the program has undefined behavior. Note that there is no algorithm that decides which
630+
/// provenance will be used. You can think of this as "guessing" the right provenance, and the guess
631+
/// will be "maximally in your favor", in the sense that if there is any way to avoid undefined
632+
/// behavior, then that is the guess that will be taken.
633633
///
634-
/// On platforms with multiple address spaces, it is your responsibility to ensure the the
634+
/// On platforms with multiple address spaces, it is your responsibility to ensure that the
635635
/// address makes sense in the address space that this pointer will be used with.
636636
///
637637
/// Using this method means that code is *not* following strict provenance rules. "Guessing" a

library/core/src/ptr/mut_ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ impl<T: ?Sized> *mut T {
189189
}
190190

191191
/// Gets the "address" portion of the pointer, and 'exposes' the "provenance" part for future
192-
/// use in pointer-to-integer casts.
192+
/// use in [`from_exposed_addr`][].
193193
///
194194
/// This is equivalent to `self as usize`, which semantically discards *provenance* and
195195
/// *address-space* information. Furthermore, this (like the `as` cast) has the implicit

0 commit comments

Comments
 (0)