Skip to content

Commit 5b5ae01

Browse files
committed
expand docs
1 parent 19ebe2f commit 5b5ae01

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/libcore/cell.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,15 +1551,20 @@ impl<T: ?Sized> UnsafeCell<T> {
15511551
}
15521552

15531553
/// Gets a mutable pointer to the wrapped value.
1554+
/// The difference to [`get`] is that this function accepts a raw pointer,
1555+
/// which is useful to avoid the creation of temporary references.
15541556
///
1555-
/// This can be cast to a pointer of any kind.
1557+
/// The result can be cast to a pointer of any kind.
15561558
/// Ensure that the access is unique (no active references, mutable or not)
15571559
/// when casting to `&mut T`, and ensure that there are no mutations
15581560
/// or mutable aliases going on when casting to `&T`.
15591561
///
1562+
/// [`get`]: #method.get
1563+
///
15601564
/// # Examples
15611565
///
1562-
/// Gradual initialization of an `UnsafeCell`:
1566+
/// Gradual initialization of an `UnsafeCell` requires `raw_get`, as
1567+
/// calling `get` would require creating a reference to uninitialized data:
15631568
///
15641569
/// ```
15651570
/// #![feature(unsafe_cell_raw_get)]

0 commit comments

Comments
 (0)