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

Check all repr hints together when checking for mis-applied attributes #47111

Merged
merged 1 commit into from
Jan 2, 2018

Conversation

hanna-kruppe
Copy link
Contributor

Fixes #47094

Besides fixing that bug, this change has a user-visible effect on the spans in the "incompatible repr hints" warning and another error: they now point at foo and/or bar in repr(foo, bar) instead of the whole attribute. This is sometimes more precise (e.g., #[repr(C, packed)] on an enum points at the packed) but sometimes not. I moved a compile-fail test to a ui test to illustrate how it now looks in the common case of only one attribute.

Fixes rust-lang#47094

Besides fixing that bug, this change has a user-visible effect on the spans in the "incompatible repr hints" warning and another error: they now point at `foo` and/or `bar` in `repr(foo, bar)` instead of the whole attribute. This is sometimes more precise (e.g., `#[repr(C, packed)]` on an enum points at the `packed`) but sometimes not. I moved a compile-fail test to a ui test to illustrate how it now looks in the common case of only one attribute.
@rust-highfive
Copy link
Collaborator

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@hanna-kruppe
Copy link
Contributor Author

r? @estebank

@rust-highfive rust-highfive assigned estebank and unassigned eddyb Jan 1, 2018
@estebank
Copy link
Contributor

estebank commented Jan 1, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Jan 1, 2018

📌 Commit 0393611 has been approved by estebank

@bors
Copy link
Contributor

bors commented Jan 2, 2018

⌛ Testing commit 0393611 with merge 5873a74...

bors added a commit that referenced this pull request Jan 2, 2018
Check all repr hints together when checking for mis-applied attributes

Fixes #47094

Besides fixing that bug, this change has a user-visible effect on the spans in the "incompatible repr hints" warning and another error: they now point at `foo` and/or `bar` in `repr(foo, bar)` instead of the whole attribute. This is sometimes more precise (e.g., `#[repr(C, packed)]` on an enum points at the `packed`) but sometimes not. I moved a compile-fail test to a ui test to illustrate how it now looks in the common case of only one attribute.
@bors
Copy link
Contributor

bors commented Jan 2, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: estebank
Pushing 5873a74 to master...

@bors bors merged commit 0393611 into rust-lang:master Jan 2, 2018
hanna-kruppe pushed a commit to hanna-kruppe/rust that referenced this pull request Jan 7, 2018
As a side effect, this fixes the warning about repr(C, simd) that has been reported during x86_64 windows builds since rust-lang#47111 (see also: rust-lang#47103)
kennytm added a commit to kennytm/rust that referenced this pull request Jan 8, 2018
…richton

Replace empty array hack with repr(align)

As a side effect, this fixes the warning about repr(C, simd) that has been reported during x86_64 windows builds since rust-lang#47111 (see also: rust-lang#47103)

r? @alexcrichton
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.

"Conflicting representation hints" warning doesn't fire if there are multiple #[repr] attrs
5 participants