|
|
@ -47,9 +47,10 @@ language cares about is preventing the following things:
|
|
|
|
function/primitive operation or returned from a function/primitive operation.
|
|
|
|
function/primitive operation or returned from a function/primitive operation.
|
|
|
|
|
|
|
|
|
|
|
|
A reference/pointer is "dangling" if it is null or not all of the bytes it
|
|
|
|
A reference/pointer is "dangling" if it is null or not all of the bytes it
|
|
|
|
points to are part of the same allocation. The span of bytes it points to is
|
|
|
|
points to are part of the same allocation (so in particular they all have to be
|
|
|
|
determined by the pointer value and the size of the pointee type. If the span
|
|
|
|
part of *some* allocation). The span of bytes it points to is determined by the
|
|
|
|
is empty, "dangling" is the same as "non-null".
|
|
|
|
pointer value and the size of the pointee type. As a consequence, if the span is
|
|
|
|
|
|
|
|
empty, "dangling" is the same as "non-null".
|
|
|
|
|
|
|
|
|
|
|
|
That's it. That's all the causes of Undefined Behavior baked into Rust. Of
|
|
|
|
That's it. That's all the causes of Undefined Behavior baked into Rust. Of
|
|
|
|
course, unsafe functions and traits are free to declare arbitrary other
|
|
|
|
course, unsafe functions and traits are free to declare arbitrary other
|
|
|
|