Skip to content

Commit d93b520

Browse files
authored
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).
2 parents c013962 + dad3270 commit d93b520

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/cell.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1936,7 +1936,7 @@ impl<T> UnsafeCell<T> {
19361936
/// Constructs a new instance of `UnsafeCell` which will wrap the specified
19371937
/// value.
19381938
///
1939-
/// All access to the inner value through methods is `unsafe`.
1939+
/// All access to the inner value through `&UnsafeCell<T>` requires `unsafe` code.
19401940
///
19411941
/// # Examples
19421942
///

0 commit comments

Comments
 (0)