Fix incorrect warning about unused repr attributes.

This commit is contained in:
Lee Jeffery
2015-06-29 20:40:18 +01:00
parent 216f6645ef
commit b676e99b60
+4 -2
View File
@@ -821,10 +821,12 @@ fn get_lints(&self) -> LintArray {
}
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;
}