Skip to content

Be conservative about deriving Debug/Default with large alignment #857

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

Merged
merged 1 commit into from
Jul 26, 2017

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Jul 26, 2017

When there is large enough alignment that we might generate padding which has more members that RUST_DERIVE_IN_ARRAY_LIMIT, we can break our ability to derive traits. This commit solves this issue conservatively: there are cases where we leave a derive on the table, because in order to know that we could add that derive, we would need to compute padding before we determine whether we can derive.

Fixes #648

r? @emilio

When there is large enough alignment that we might generate padding which has
more members that `RUST_DERIVE_IN_ARRAY_LIMIT`, we can break our ability to
derive traits. This commit solves this issue conservatively: there are cases
where we leave a derive on the table, because in order to know that we could add
that derive, we would need to compute padding before we determine whether we can
derive.

Fixes rust-lang#648
Copy link
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@emilio
Copy link
Contributor

emilio commented Jul 26, 2017

@bors-servo r+

@emilio
Copy link
Contributor

emilio commented Jul 26, 2017

Oh, right...

@emilio emilio merged commit be55022 into rust-lang:master Jul 26, 2017
@fitzgen fitzgen deleted the derive-debug-with-padding branch July 26, 2017 19:49
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.

2 participants