diff options
| -rw-r--r-- | src/librustc_lint/builtin.rs | 6 |
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; } |
