-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Lang: Stabilize usage of rustc_nonnull_optimization_guaranteed on -1 #97122
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
Comments
@rfcbot merge |
Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
@sunfishcode Should OwnedSocket have the same optimization applied? |
@joshtriplett Yes, it should, and it does. |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
I/O Safety (#87074) uses types which are
repr(transparent)
wrappers around file descriptors or sockets, and which have a niche at -1 which is an invalid fd/socket. Those types userustc_nonnull_optimization_guaranteed
, which together with the niche, allows using things likeOption<OwnedFd>
in FFI.(The attribute remains unstable, and is misnamed at this point since it shouldn't say "nonnull"; it should be something like
rustc_niche_optimization_guaranteed
, but that shouldn't block this issue.)Before stabilizing those types, we'd like to confirm T-lang consensus that we have no objections to exposing a type with a guaranteed non-zero niche (in this case, a guaranteed niche at -1). This commits us to continuing to provide some mechanism (even if perma-unstable) for declaring non-zero niches and allowing their use in FFI.
The text was updated successfully, but these errors were encountered: