about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLee Jeffery <lee@leejeffery.co.uk>2015-06-29 20:40:18 +0100
committerLee Jeffery <lee@leejeffery.co.uk>2015-06-29 20:40:18 +0100
commitb676e99b605274c48bea04d344ff18c546041a8f (patch)
tree5c7b7fc0ca4729164cc5058bb60c99d48eaac925
parent216f6645ef0c93776e9f350f29c02780fb7bf673 (diff)
Fix incorrect warning about unused repr attributes.
-rw-r--r--src/librustc_lint/builtin.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs
index db48608823d..16db45c909d 100644
--- a/src/librustc_lint/builtin.rs
+++ b/src/librustc_lint/builtin.rs
@@ -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;
         }