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:
Matthias Krüger 2022-11-06 08:35:27 +01:00 committed by GitHub
commit d93b5200d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
///