Skip to content

Commit d24026b

Browse files
committed
Fix broken link
`write` is ambiguous because there's also a macro called `write`. Also removed unnecessary and potentially confusing link to a function in its own docs.
1 parent 325acef commit d24026b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/core/src/ptr/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ mod mut_ptr;
129129
/// Additionally, if `T` is not [`Copy`], using the pointed-to value after
130130
/// calling `drop_in_place` can cause undefined behavior. Note that `*to_drop =
131131
/// foo` counts as a use because it will cause the value to be dropped
132-
/// again. [`write`] can be used to overwrite data without causing it to be
132+
/// again. [`write()`] can be used to overwrite data without causing it to be
133133
/// dropped.
134134
///
135135
/// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned.
@@ -639,7 +639,7 @@ pub unsafe fn replace<T>(dst: *mut T, mut src: T) -> T {
639639
/// `*src` can violate memory safety. Note that assigning to `*src` counts as a
640640
/// use because it will attempt to drop the value at `*src`.
641641
///
642-
/// [`write`] can be used to overwrite data without causing it to be dropped.
642+
/// [`write()`] can be used to overwrite data without causing it to be dropped.
643643
///
644644
/// ```
645645
/// use std::ptr;
@@ -878,7 +878,7 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
878878
/// Overwrites a memory location with the given value without reading or
879879
/// dropping the old value.
880880
///
881-
/// Unlike [`write`], the pointer may be unaligned.
881+
/// Unlike [`write()`], the pointer may be unaligned.
882882
///
883883
/// `write_unaligned` does not drop the contents of `dst`. This is safe, but it
884884
/// could leak allocations or resources, so care should be taken not to overwrite
@@ -1085,7 +1085,7 @@ pub unsafe fn read_volatile<T>(src: *const T) -> T {
10851085
/// Just like in C, whether an operation is volatile has no bearing whatsoever
10861086
/// on questions involving concurrent access from multiple threads. Volatile
10871087
/// accesses behave exactly like non-atomic accesses in that regard. In particular,
1088-
/// a race between a [`write_volatile`] and any other operation (reading or writing)
1088+
/// a race between a `write_volatile` and any other operation (reading or writing)
10891089
/// on the same location is undefined behavior.
10901090
///
10911091
/// # Examples

0 commit comments

Comments
 (0)