It should be possible to dereference NonNull in unsafe blocks #48277
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
In porting some code from
*mut T
toNonNull<T>
, I've been having to add a lot of.as_ptr()
conversions in order to dereference (i.e.,*ptr
vs*ptr.as_ptr()
). It'd be great it were possible to dereferenceNonNull
directly when in unsafe blocks.My guess is that this would require adding some sort of
UnsafeDeref
/UnsafeDerefMut
traits and making the compiler know about them, so this is probably no simple task.The text was updated successfully, but these errors were encountered: