mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
Fix incorrect warning about unused repr attributes.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user