We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dd37e21 + 734ca5e commit 8ca2612Copy full SHA for 8ca2612
src/ffi.md
@@ -659,7 +659,8 @@ Certain Rust types are defined to never be `null`. This includes references (`&T
659
`&mut T`), boxes (`Box<T>`), and function pointers (`extern "abi" fn()`). When
660
interfacing with C, pointers that might be `null` are often used, which would seem to
661
require some messy `transmute`s and/or unsafe code to handle conversions to/from Rust types.
662
-However, the language provides a workaround.
+However, trying to construct/work with these invalid values **is undefined behavior**,
663
+so you should use the following workaround instead.
664
665
As a special case, an `enum` is eligible for the "nullable pointer optimization" if it contains
666
exactly two variants, one of which contains no data and the other contains a field of one of the
0 commit comments