File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff 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)]
You can’t perform that action at this time.
0 commit comments