cbindgen
cbindgen copied to clipboard
Emit `_Nullable` alongside `_Nonnull`
I was playing with adding _Nonnull annotations to an FFI that I consume in Swift. If you configure cbindgen to emit _Nonnull and run the header through xcodebuild, much like giving a mouse a cookie, Xcode will ask for more. Xcode complains that all the other pointers don't have explicit _Nullable annotations. It would be nice if you could configure nullable_attribute and have cbindgen emit it whenever it encounters an Optional<&T>, Optional<&mut T>, *const T, or *mut T.
Patch welcome :)