}
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
+ let attrs = cx.tcx.hir().attrs(item.hir_id());
if is_relevant_item(cx, item) {
- check_attrs(cx, item.span, item.ident.name, &item.attrs)
+ check_attrs(cx, item.span, item.ident.name, attrs)
}
match item.kind {
ItemKind::ExternCrate(..) | ItemKind::Use(..) => {
- let skip_unused_imports = item.attrs.iter().any(|attr| attr.has_name(sym::macro_use));
+ let skip_unused_imports = attrs.iter().any(|attr| attr.has_name(sym::macro_use));
- for attr in item.attrs {
+ for attr in attrs {
if in_external_macro(cx.sess(), attr.span) {
return;
}
fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'_>) {
if is_relevant_impl(cx, item) {
- check_attrs(cx, item.span, item.ident.name, &item.attrs)
+ check_attrs(cx, item.span, item.ident.name, cx.tcx.hir().attrs(item.hir_id()))
}
}
fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx TraitItem<'_>) {
if is_relevant_trait(cx, item) {
- check_attrs(cx, item.span, item.ident.name, &item.attrs)
+ check_attrs(cx, item.span, item.ident.name, cx.tcx.hir().attrs(item.hir_id()))
}
}
}
diag.span_suggestion(span, "try", sugg, Applicability::MaybeIncorrect);
if !unix_suggested && is_unix(os) {
- diag.help("Did you mean `unix`?");
+ diag.help("did you mean `unix`?");
unix_suggested = true;
}
}