about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-06 08:35:27 +0100
committerGitHub <noreply@github.com>2022-11-06 08:35:27 +0100
commitd93b5200d50a6cfb6bc0cba7504e6c1628c568f3 (patch)
tree72a85da9261367cda4133c41c20847e2d50d0915
parentc013962695462a809163b30b8a3fe1e46eaf6a77 (diff)
parentdad327090af66f0519f5beaf471ae293834dae7f (diff)
downloadrust-d93b5200d50a6cfb6bc0cba7504e6c1628c568f3.tar.gz
rust-d93b5200d50a6cfb6bc0cba7504e6c1628c568f3.zip
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).
-rw-r--r--library/core/src/cell.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs
index e6a11218139..f2975d05457 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -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
     ///