Rollup merge of #104002 - RalfJung:unsafecell-new, r=JohnTitor
fix a comment in UnsafeCell::new There are several safe methods that access the inner value: `into_inner` has existed since forever and `get_mut` also exists since recently. So this comment seems just wrong. But `&self` methods return raw pointers and thus require unsafe code (though the methods themselves are still safe).
This commit is contained in:
commit
d93b5200d5
@ -1936,7 +1936,7 @@ impl<T> UnsafeCell<T> {
|
||||
/// Constructs a new instance of `UnsafeCell` which will wrap the specified
|
||||
/// value.
|
||||
///
|
||||
/// All access to the inner value through methods is `unsafe`.
|
||||
/// All access to the inner value through `&UnsafeCell<T>` requires `unsafe` code.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user