Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upUse of ptr::NonNull in FFI #49220
Comments
pietroalbini
added
C-enhancement
A-ffi
T-libs
labels
Mar 21, 2018
This comment has been minimized.
This comment has been minimized.
|
cc #27730 |
This comment has been minimized.
This comment has been minimized.
|
|
kornelski
closed this
Aug 3, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kornelski commentedMar 20, 2018
•
edited
I think it would be interesting to use
ptr::NonNullto explicitly document FFI arguments that aren't allowed to beNULL, so that e.g.:could be an implementation for:
However,
ptr::NonNulldoesn't have#[repr(transparent)], so I'm not sure if that is sound. Whether it's supposed to be used this way or not, it may be worth explicitly documenting it. Currently its docs don't say anything about FFI compatibility.