Open
Description
Add a note like the one in this commit to the documentation of references and nonnull: fafa489
Something like what that commit does for Box<T>
:
//! **Important.** At least at present, you should avoid using
//! `Box<T>` types for functions that are defined in C but invoked
//! from Rust. In those cases, you should directly mirror the C types
//! as closely as possible. Using types like `Box<T>` where the C
//! definition is just using `T*` can lead to undefined behavior, as
//! described in [rust-lang/unsafe-code-guidelines#198][ucg#198].
but replacing Box<T>
with the reference types and NonNull<T>
.