File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,10 @@ language cares about is preventing the following things:
47
47
function/primitive operation or returned from a function/primitive operation.
48
48
49
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".
50
+ points to are part of the same allocation (so in particular they all have to be
51
+ part of * some* allocation). The span of bytes it points to is determined by the
52
+ pointer value and the size of the pointee type. As a consequence, if the span is
53
+ empty, "dangling" is the same as "non-null".
53
54
54
55
That's it. That's all the causes of Undefined Behavior baked into Rust. Of
55
56
course, unsafe functions and traits are free to declare arbitrary other
You can’t perform that action at this time.
0 commit comments