-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
ty: use Align for ReprOptions pack and align. #63914
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @eddyb (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -2057,8 +2058,8 @@ impl_stable_hash_for!(struct ReprFlags { | |||
#[derive(Copy, Clone, Debug, Eq, PartialEq, RustcEncodable, RustcDecodable, Default)] | |||
pub struct ReprOptions { | |||
pub int: Option<attr::IntType>, | |||
pub align: u32, | |||
pub pack: u32, | |||
pub align: Option<Align>, |
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.
This can just be Align
, although this is probably okay too (cc @oli-obk).
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.
That's what I tried initially, but some code in src/librustc_typeck/check/mod.rs
explicitly checks if an alignment is set.
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.
We could also use an enum
enum AlignRepr {
Align(Align),
Packed(Align),
}
To encode the fact that there can be only one of them.
@bors r+ |
📌 Commit c8a69e2 has been approved by |
ty: use Align for ReprOptions pack and align.
ty: use Align for ReprOptions pack and align.
ty: use Align for ReprOptions pack and align.
Rollup of 7 pull requests Successful merges: - #63867 (resolve: Block expansion of a derive container until all its derives are resolved) - #63880 (Validation: check raw wide pointer metadata) - #63914 (ty: use Align for ReprOptions pack and align.) - #63941 (rustbuild: allow disabling deny(warnings) for bootstrap) - #63949 (Fix build src/libtest) - #63984 (Update rust-installer to limit memory use) - #63992 (Small improvement for Ord implementation of integers) Failed merges: r? @ghost
No description provided.