File tree 1 file changed +7
-2
lines changed
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> {
1551
1551
}
1552
1552
1553
1553
/// 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.
1554
1556
///
1555
- /// This can be cast to a pointer of any kind.
1557
+ /// The result can be cast to a pointer of any kind.
1556
1558
/// Ensure that the access is unique (no active references, mutable or not)
1557
1559
/// when casting to `&mut T`, and ensure that there are no mutations
1558
1560
/// or mutable aliases going on when casting to `&T`.
1559
1561
///
1562
+ /// [`get`]: #method.get
1563
+ ///
1560
1564
/// # Examples
1561
1565
///
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:
1563
1568
///
1564
1569
/// ```
1565
1570
/// #![feature(unsafe_cell_raw_get)]
You can’t perform that action at this time.
0 commit comments