Skip to content

Commit 0521596

Browse files
RalfJungGankra
authored andcommitted
fix def.n of dangling
1 parent 121a5a0 commit 0521596

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/what-unsafe-does.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ language cares about is preventing the following things:
4646
"Producing" a value happens any time a value is assigned, passed to a
4747
function/primitive operation or returned from a function/primitive operation.
4848

49-
A reference/pointer is "dangling" if not all of the bytes it points to are part
50-
of the same allocation. In particular, null pointers are dangling. The span of bytes it
51-
points to is determined by the pointer value and the size of the pointee type.
52-
If the span is empty, "dangling" is the same as "non-null".
49+
A reference/pointer is "dangling" if it is null or not all of the bytes it
50+
points to are part of the same allocation. The span of bytes it points to is
51+
determined by the pointer value and the size of the pointee type. If the span
52+
is empty, "dangling" is the same as "non-null".
5353

5454
That's it. That's all the causes of Undefined Behavior baked into Rust. Of
5555
course, unsafe functions and traits are free to declare arbitrary other

0 commit comments

Comments
 (0)