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

ty: use Align for ReprOptions pack and align. #63914

Merged
merged 1 commit into from
Aug 29, 2019

Conversation

hvenev
Copy link
Contributor

@hvenev hvenev commented Aug 26, 2019

No description provided.

@rust-highfive
Copy link
Collaborator

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 26, 2019
@@ -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>,
Copy link
Member

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).

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@eddyb
Copy link
Member

eddyb commented Aug 27, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Aug 27, 2019

📌 Commit c8a69e2 has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2019
Centril added a commit to Centril/rust that referenced this pull request Aug 29, 2019
ty: use Align for ReprOptions pack and align.
Centril added a commit to Centril/rust that referenced this pull request Aug 29, 2019
ty: use Align for ReprOptions pack and align.
Centril added a commit to Centril/rust that referenced this pull request Aug 29, 2019
ty: use Align for ReprOptions pack and align.
bors added a commit that referenced this pull request Aug 29, 2019
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
@bors bors merged commit c8a69e2 into rust-lang:master Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants