Skip to content

Commit b29823c

Browse files
committed
replace 'UB on raw ptr deref' with UB on place projection/access
1 parent 9cd5c5a commit b29823c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/behavior-considered-undefined.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ code.
2323
</div>
2424

2525
* Data races.
26-
* Evaluating a [dereference expression] (`*expr`) on a raw pointer that is
27-
[dangling] or unaligned, even in [place expression context]
28-
(e.g. `addr_of!(*expr)`).
26+
* Accessing (loading from or storing to) a place that is [dangling] or unaligned.
27+
* Performing a place projection that violates the requirements of [in-bounds
28+
pointer arithmetic][offset]. A place projection is a [field
29+
expression][project-field], a [tuple index expression][project-tuple], or an
30+
[array/slice index expression][project-slice].
2931
* Breaking the [pointer aliasing rules]. `Box<T>`, `&mut T` and `&T` follow
3032
LLVM’s scoped [noalias] model, except if the `&T` contains an
3133
[`UnsafeCell<U>`]. References and boxes must not be [dangling] while they are
@@ -124,8 +126,11 @@ must never exceed `isize::MAX`.
124126
[Rustonomicon]: ../nomicon/index.html
125127
[`NonNull<T>`]: ../core/ptr/struct.NonNull.html
126128
[`NonZero*`]: ../core/num/index.html
127-
[dereference expression]: expressions/operator-expr.md#the-dereference-operator
128129
[place expression context]: expressions.md#place-expressions-and-value-expressions
129130
[rules]: inline-assembly.md#rules-for-inline-assembly
130131
[points to]: #pointed-to-bytes
131132
[pointed to]: #pointed-to-bytes
133+
[offset]: ../std/primitive.pointer.html#method.offset
134+
[project-field]: expressions/field-expr.md
135+
[project-tuple]: expressions/tuple-expr.md#tuple-indexing-expressions
136+
[project-slice]: expressions/array-expr.md#array-and-slice-indexing-expressions

0 commit comments

Comments
 (0)