miniblog.
← Back to all posts
Wilfred Hughes
Oct 19, 2022 at 00:56
Today I learnt about the NonNull<T> type in Rust:
https://doc.rust-lang.org/nightly/core/ptr/struct.NonNull.html
It's a *mut T that is never null. Rust is trusting you even more than a normal *mut T, which is slightly daunting.
NonNull in core::ptr - Rust
`*mut T` but non-zero and covariant.