Skip to content

Commit 4733190

Browse files
committed
Rollup merge of #23183 - steveklabnik:gh22572, r=Manishearth
They're opt-in now. Fixes #22572
2 parents 811c575 + 9653a52 commit 4733190

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/libcore/cell.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,6 @@ impl<'b, T> DerefMut for RefMut<'b, T> {
631631
///
632632
/// Types like `Cell<T>` and `RefCell<T>` use this type to wrap their internal data.
633633
///
634-
/// `UnsafeCell<T>` doesn't opt-out from any marker traits, instead, types with an `UnsafeCell<T>`
635-
/// interior are expected to opt-out from those traits themselves.
636-
///
637634
/// # Examples
638635
///
639636
/// ```

src/libcore/marker.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,9 @@ pub trait Copy : MarkerTrait {
193193
/// the `sync` crate do ensure that any mutation cannot cause data
194194
/// races. Hence these types are `Sync`.
195195
///
196-
/// Users writing their own types with interior mutability (or anything
197-
/// else that is not thread-safe) should use the `NoSync` marker type
198-
/// (from `std::marker`) to ensure that the compiler doesn't
199-
/// consider the user-defined type to be `Sync`. Any types with
200-
/// interior mutability must also use the `std::cell::UnsafeCell` wrapper
201-
/// around the value(s) which can be mutated when behind a `&`
202-
/// reference; not doing this is undefined behaviour (for example,
203-
/// `transmute`-ing from `&T` to `&mut T` is illegal).
196+
/// Any types with interior mutability must also use the `std::cell::UnsafeCell` wrapper around the
197+
/// value(s) which can be mutated when behind a `&` reference; not doing this is undefined
198+
/// behaviour (for example, `transmute`-ing from `&T` to `&mut T` is illegal).
204199
#[stable(feature = "rust1", since = "1.0.0")]
205200
#[lang="sync"]
206201
#[rustc_on_unimplemented = "`{Self}` cannot be shared between threads safely"]

0 commit comments

Comments
 (0)