57
57
> ** Note** : For ` rustc ` , those types are [ ` NonNull<T> ` ] and [ ` NonZero* ` ] .
58
58
> Requesting custom invalid types requires the unstable ` rustc_layout_scalar_valid_range_* ` attributes.
59
59
60
- > ** Note** : Undefined behavior affects the entire program. For example, calling
61
- > a function in C that exhibits undefined behavior of C means your entire
62
- > program contains undefined behaviour that can also affect the Rust code. And
63
- > vice versa, undefined behavior in Rust can cause adverse affects on code
64
- > executed by any FFI calls to other languages.
65
-
66
60
A reference/pointer is "dangling" if it is null or not all of the bytes it
67
61
points to are part of the same allocation (so in particular they all have to be
68
62
part of * some* allocation). The span of bytes it points to is determined by the
@@ -72,6 +66,12 @@ entire range, so it is important that the length metadata is never too
72
66
large. In particular, allocations and therefore slices cannot be bigger than
73
67
` isize::MAX ` bytes.
74
68
69
+ > ** Note** : Undefined behavior affects the entire program. For example, calling
70
+ > a function in C that exhibits undefined behavior of C means your entire
71
+ > program contains undefined behaviour that can also affect the Rust code. And
72
+ > vice versa, undefined behavior in Rust can cause adverse affects on code
73
+ > executed by any FFI calls to other languages.
74
+
75
75
[ noalias ] : http://llvm.org/docs/LangRef.html#noalias
76
76
[ pointer aliasing rules ] : http://llvm.org/docs/LangRef.html#pointer-aliasing-rules
77
77
[ undef ] : http://llvm.org/docs/LangRef.html#undefined-values
0 commit comments