Skip to content

Commit

Permalink
Fix incorrect warning about unused repr attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Jeffery committed Jun 29, 2015
1 parent 216f664 commit b676e99
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustc_lint/builtin.rs
Expand Up @@ -821,10 +821,12 @@ impl LintPass for NonCamelCaseTypes {
}

fn check_item(&mut self, cx: &Context, it: &ast::Item) {
let has_extern_repr = it.attrs.iter().any(|attr| {
let extern_repr_count = it.attrs.iter().filter(|attr| {
attr::find_repr_attrs(cx.tcx.sess.diagnostic(), attr).iter()
.any(|r| r == &attr::ReprExtern)
});
}).count();
let has_extern_repr = extern_repr_count > 0;

if has_extern_repr {
return;
}
Expand Down

0 comments on commit b676e99

Please sign in to comment.