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
Support Result<T, E> across FFI when niche optimization can be used #122253
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
r? compiler |
Hmmm. |
Sorry, I can't review these lint implementations. |
☔ The latest upstream changes (presumably #124271) made this pull request unmergeable. Please resolve the merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me after rebasing
Allow allow enums like `Result<T, E>` to be used across FFI if the T/E can be niche optimized and the non-niche-optimized type is FFI safe.
Fields are disallowed so checking the top attribute is enough.
Couldn't find documentation supporting that single-variant `#[repr(Rust)]` enums with RHS assigned work as expected with this change. ```rust enum Variants { A = 17, } // Would this be zero sized optimized guaranteed? ```
@bors r=davidtwco |
@MasterAwesome: 🔑 Insufficient privileges: Not in reviewers |
I guess I don't have permissions @davidtwco, can you queue this in? |
Allow allow enums like
Result<T, E>
to be used across FFI if the T/E can be niche optimized and the non-niche-optimized type is FFI safe.Implementation of rust-lang/rfcs#3391
Tracking issue: #110503
Additional ABI and codegen tests were added in #115372