Skip to content

Commit 419dcc9

Browse files
committed
Make UnsafeCell::value private
1 parent efebe45 commit 419dcc9

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

Diff for: src/libcore/cell.rs

+2-11
Original file line numberDiff line numberDiff line change
@@ -631,18 +631,10 @@ impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> {
631631
///
632632
/// unsafe impl<T> Sync for NotThreadSafe<T> {}
633633
/// ```
634-
///
635-
/// **NOTE:** `UnsafeCell<T>`'s fields are public to allow static initializers. It is not
636-
/// recommended to access its fields directly, `get` should be used instead.
637634
#[lang = "unsafe_cell"]
638635
#[stable(feature = "rust1", since = "1.0.0")]
639636
pub struct UnsafeCell<T: ?Sized> {
640-
/// Wrapped value
641-
///
642-
/// This field should not be accessed directly, it is made public for static
643-
/// initializers.
644-
#[unstable(feature = "core")]
645-
pub value: T,
637+
value: T,
646638
}
647639

648640
impl<T: ?Sized> !Sync for UnsafeCell<T> {}
@@ -651,8 +643,7 @@ impl<T> UnsafeCell<T> {
651643
/// Constructs a new instance of `UnsafeCell` which will wrap the specified
652644
/// value.
653645
///
654-
/// All access to the inner value through methods is `unsafe`, and it is highly discouraged to
655-
/// access the fields directly.
646+
/// All access to the inner value through methods is `unsafe`.
656647
///
657648
/// # Examples
658649
///

0 commit comments

Comments
 (0)