@@ -1941,32 +1941,32 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
19411941/// The precise Rust aliasing rules are somewhat in flux, but the main points are not contentious:
19421942///
19431943/// - If you create a safe reference with lifetime `'a` (either a `&T` or `&mut T` reference), then
1944- /// you must not access the data in any way that contradicts that reference for the remainder of
1945- /// `'a`. For example, this means that if you take the `*mut T` from an `UnsafeCell<T>` and cast it
1946- /// to an `&T`, then the data in `T` must remain immutable (modulo any `UnsafeCell` data found
1947- /// within `T`, of course) until that reference's lifetime expires. Similarly, if you create a `&mut
1948- /// T` reference that is released to safe code, then you must not access the data within the
1949- /// `UnsafeCell` until that reference expires.
1944+ /// you must not access the data in any way that contradicts that reference for the remainder of
1945+ /// `'a`. For example, this means that if you take the `*mut T` from an `UnsafeCell<T>` and cast it
1946+ /// to an `&T`, then the data in `T` must remain immutable (modulo any `UnsafeCell` data found
1947+ /// within `T`, of course) until that reference's lifetime expires. Similarly, if you create a
1948+ /// `&mut T` reference that is released to safe code, then you must not access the data within the
1949+ /// `UnsafeCell` until that reference expires.
19501950///
19511951/// - For both `&T` without `UnsafeCell<_>` and `&mut T`, you must also not deallocate the data
1952- /// until the reference expires. As a special exception, given an `&T`, any part of it that is
1953- /// inside an `UnsafeCell<_>` may be deallocated during the lifetime of the reference, after the
1954- /// last time the reference is used (dereferenced or reborrowed). Since you cannot deallocate a part
1955- /// of what a reference points to, this means the memory an `&T` points to can be deallocated only if
1956- /// *every part of it* (including padding) is inside an `UnsafeCell`.
1952+ /// until the reference expires. As a special exception, given an `&T`, any part of it that is
1953+ /// inside an `UnsafeCell<_>` may be deallocated during the lifetime of the reference, after the
1954+ /// last time the reference is used (dereferenced or reborrowed). Since you cannot deallocate a part
1955+ /// of what a reference points to, this means the memory an `&T` points to can be deallocated only if
1956+ /// *every part of it* (including padding) is inside an `UnsafeCell`.
19571957///
1958- /// However, whenever a `&UnsafeCell<T>` is constructed or dereferenced, it must still point to
1958+ /// However, whenever a `&UnsafeCell<T>` is constructed or dereferenced, it must still point to
19591959/// live memory and the compiler is allowed to insert spurious reads if it can prove that this
19601960/// memory has not yet been deallocated.
19611961///
19621962/// To assist with proper design, the following scenarios are explicitly declared legal
19631963/// for single-threaded code:
19641964///
19651965/// 1. A `&T` reference can be released to safe code and there it can co-exist with other `&T`
1966- /// references, but not with a `&mut T`
1966+ /// references, but not with a `&mut T`
19671967///
19681968/// 2. A `&mut T` reference may be released to safe code provided neither other `&mut T` nor `&T`
1969- /// co-exist with it. A `&mut T` must always be unique.
1969+ /// co-exist with it. A `&mut T` must always be unique.
19701970///
19711971/// Note that whilst mutating the contents of an `&UnsafeCell<T>` (even while other
19721972/// `&UnsafeCell<T>` references alias the cell) is
0 commit comments