Skip to content

Commit ee50cdb

Browse files
committed
Docs: do not rely on noalias as a spec
1 parent 200deb6 commit ee50cdb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ that reference expires.
5454
accesses (or use atomics).
5555

5656
## How does it work?
57-
Under the current rules, all types that are [`!Unpin`] do not emit `noalias` for `&T` and `&mut T`
58-
in [LLVM] and are thus able to alias. For [`UnsafeAliasCell<T>`] to be sound, it is therefore
59-
required to be contained in only [`!Unpin`] types.
57+
Under the current rules, all types that are [`!Unpin`] are allowed to be aliased. So for
58+
[`UnsafeAliasCell<T>`] to be sound, it is therefore required to be contained in only [`!Unpin`] types.
59+
60+
[`UnsafeAliasCell<T>`] is made up of [`UnsafeCell<T>`] and [`PhantomPinned`] to enable both interior
61+
mutability and allow aliasing.
6062

6163
[stdlib]: https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html
6264
[`.get()`]: UnsafeAliasCell::get
@@ -67,3 +69,4 @@ required to be contained in only [`!Unpin`] types.
6769
[`UnsafeCell<T>`]: https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html
6870
[`UnsafeAliasCell<U>`]: https://docs.rs/unsafe-alias-cell/latest/unsafe_alias_cell/struct.UnsafeAliasCell.html
6971
[`UnsafeCell<U>`]: https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html
72+
[`PhantomPinned`]: https://doc.rust-lang.org/std/marker/struct.PhantomPinned.html

0 commit comments

Comments
 (0)