Skip to content

Commit f5c12b3

Browse files
committed
add comparison with some related types
1 parent 481f2ca commit f5c12b3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

text/0000-maybe-dangling.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@ Miri is adjusted as follows:
178178
The `-Zmiri-retag-fields` flag makes retagging "peer into" compound types to retag all references it can find.
179179
This flag needs to become the default to make Miri actually detect all UB in the LLVM IR we generate. This RFC says that that traversal stops at `MaybeDangling`.)
180180

181+
### Comparison with some other types that affect aliasing
182+
183+
- `UnsafeCell`: disables aliasing (and affects but does not fully disable dereferenceable) behind shared refs, i.e. `&UnsafeCell<T>` is special. `UnsafeCell<&T>` (by-val, fully owned) is not special at all and basically like `&T`; `&mut UnsafeCell<T>` is also not special.
184+
- [`UnsafeAliased`](https://github.com/rust-lang/rfcs/pull/3467): disables aliasing (and affects but does not fully disable dereferenceable) behind mutable refs, i.e. `&mut UnsafeAliased<T>` is special. `UnsafeAliased<&mut T>` (by-val, fully owned) is not special at all and basically like `&mut T`; `&UnsafeAliased<T>` is also not special.
185+
- `MaybeDangling`: disables aliasing and dereferencable *of all references (and boxes) directly inside it*, i.e. `MaybeDangling<&[mut] T>` is special. `&[mut] MaybeDangling<T>` is not special at all and basically like `&[mut] T`.
186+
187+
181188
# Drawbacks
182189
[drawbacks]: #drawbacks
183190

0 commit comments

Comments
 (0)