File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,11 @@ that reference expires.
54
54
accesses (or use atomics).
55
55
56
56
## 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.
60
62
61
63
[ stdlib ] : https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html
62
64
[ `.get()` ] : UnsafeAliasCell::get
@@ -67,3 +69,4 @@ required to be contained in only [`!Unpin`] types.
67
69
[ `UnsafeCell<T>` ] : https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html
68
70
[ `UnsafeAliasCell<U>` ] : https://docs.rs/unsafe-alias-cell/latest/unsafe_alias_cell/struct.UnsafeAliasCell.html
69
71
[ `UnsafeCell<U>` ] : https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html
72
+ [ `PhantomPinned` ] : https://doc.rust-lang.org/std/marker/struct.PhantomPinned.html
You can’t perform that action at this time.
0 commit comments