Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Option<{Owned,Borrowed}{Fd,Socket}> FFI-safe. #24

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

sunfishcode
Copy link
Owner

Mark {Owned,Borrowed}{Fd,Socket} as rustc_nonnull_optimization_guaranteed
so that they can be used in Option in FFI.

This allows the removal of the allow(improper_ctypes).

This depends on rust-lang/rust#94586.

Mark `{Owned,Borrowed}{Fd,Socket}` as `rustc_nonnull_optimization_guaranteed`
so that they can be used in `Option` in FFI.

This allows the removal of the `allow(improper_ctypes)`.
@sunfishcode sunfishcode marked this pull request as ready for review March 9, 2022 18:04
@sunfishcode
Copy link
Owner Author

rust-lang/rust#94586 is now in nightly, and the tests here now pass.

I plan to submit the corresponding change to std too, but that needs to wait for rust-lang/rust#94586 landing in beta, which is used as the stage0 compiler.

@sunfishcode sunfishcode merged commit c48374a into main Mar 9, 2022
@sunfishcode sunfishcode deleted the sunfishcode/ffi-types branch March 9, 2022 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant