@@ -557,16 +557,16 @@ pub const fn null_mut<T>() -> *mut T {
557
557
558
558
/// Creates an invalid pointer with the given address.
559
559
///
560
- /// This is *currently* equivalent to `addr as *const T` but it expresses the intended semantic
561
- /// more clearly, and may become important under future memory models .
560
+ /// This is different from `addr as *const T`, which creates a pointer that picks up a previously
561
+ /// exposed provenance. See [`from_exposed_addr`] for more details on that operation .
562
562
///
563
563
/// The module's top-level documentation discusses the precise meaning of an "invalid"
564
564
/// pointer but essentially this expresses that the pointer is not associated
565
565
/// with any actual allocation and is little more than a usize address in disguise.
566
566
///
567
567
/// This pointer will have no provenance associated with it and is therefore
568
568
/// UB to read/write/offset. This mostly exists to facilitate things
569
- /// like ptr::null and NonNull::dangling which make invalid pointers.
569
+ /// like ` ptr::null` and ` NonNull::dangling` which make invalid pointers.
570
570
///
571
571
/// (Standard "Zero-Sized-Types get to cheat and lie" caveats apply, although it
572
572
/// may be desirable to give them their own API just to make that 100% clear.)
@@ -588,16 +588,16 @@ pub const fn invalid<T>(addr: usize) -> *const T {
588
588
589
589
/// Creates an invalid mutable pointer with the given address.
590
590
///
591
- /// This is *currently* equivalent to `addr as *mut T` but it expresses the intended semantic
592
- /// more clearly, and may become important under future memory models .
591
+ /// This is different from `addr as *mut T`, which creates a pointer that picks up a previously
592
+ /// exposed provenance. See [`from_exposed_addr_mut`] for more details on that operation .
593
593
///
594
594
/// The module's top-level documentation discusses the precise meaning of an "invalid"
595
595
/// pointer but essentially this expresses that the pointer is not associated
596
596
/// with any actual allocation and is little more than a usize address in disguise.
597
597
///
598
598
/// This pointer will have no provenance associated with it and is therefore
599
599
/// UB to read/write/offset. This mostly exists to facilitate things
600
- /// like ptr::null and NonNull::dangling which make invalid pointers.
600
+ /// like ` ptr::null` and ` NonNull::dangling` which make invalid pointers.
601
601
///
602
602
/// (Standard "Zero-Sized-Types get to cheat and lie" caveats apply, although it
603
603
/// may be desirable to give them their own API just to make that 100% clear.)
0 commit comments