Skip to content

Fix incorrect warning about unused repr attributes. #26663

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 3 commits into from Jun 30, 2015
Merged

Fix incorrect warning about unused repr attributes. #26663

merged 3 commits into from Jun 30, 2015

Conversation

ghost
Copy link

@ghost ghost commented Jun 29, 2015

Fixes #26646.

Loops over all #[repr(..)] attributes instead of stopping at the first one to make sure they are all marked as used. Previously it stopped after the first #[repr(C)] was found causing all other attributes to be skipped by the linter.

@rust-highfive
Copy link
Contributor

r? @alexcrichton

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

@alexcrichton
Copy link
Member

Thanks for the PR! Could you also add a test for this as well?

#[repr(C)]
pub struct Bar;

fn main() { }
Copy link
Member

Choose a reason for hiding this comment

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

There should be a newline at the end of the file.

@sanxiyn
Copy link
Member

sanxiyn commented Jun 30, 2015

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 30, 2015

📌 Commit e8fe55f has been approved by sanxiyn

bors added a commit that referenced this pull request Jun 30, 2015
Fixes #26646.

Loops over all `#[repr(..)]` attributes instead of stopping at the first one to make sure they are all marked as used. Previously it stopped after the first `#[repr(C)]` was found causing all other attributes to be skipped by the linter.
@bors
Copy link
Collaborator

bors commented Jun 30, 2015

⌛ Testing commit e8fe55f with merge fdf219d...

@bors bors merged commit e8fe55f into rust-lang:master Jun 30, 2015
@ghost ghost deleted the fix-repr-attribute branch July 4, 2015 10:54
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.

5 participants