Skip to content

Commit 0449607

Browse files
committed
Remove hir::Arm::attrs.
1 parent b32cffe commit 0449607

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clippy_lints/src/matches.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,11 +1207,11 @@ fn find_matches_sugg(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>], expr
12071207
if b0 != b1;
12081208
let if_guard = &b0_arms[0].guard;
12091209
if if_guard.is_none() || b0_arms.len() == 1;
1210-
if b0_arms[0].attrs.is_empty();
1210+
if cx.tcx.hir().attrs(b0_arms[0].hir_id).is_empty();
12111211
if b0_arms[1..].iter()
12121212
.all(|arm| {
12131213
find_bool_lit(&arm.body.kind, desugared).map_or(false, |b| b == b0) &&
1214-
arm.guard.is_none() && arm.attrs.is_empty()
1214+
arm.guard.is_none() && cx.tcx.hir().attrs(arm.hir_id).is_empty()
12151215
});
12161216
then {
12171217
// The suggestion may be incorrect, because some arms can have `cfg` attributes

clippy_lints/src/utils/inspector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'tcx> LateLintPass<'tcx> for DeepCodeInspector {
9696
}
9797

9898
fn check_arm(&mut self, cx: &LateContext<'tcx>, arm: &'tcx hir::Arm<'_>) {
99-
if !has_attr(cx.sess(), &arm.attrs) {
99+
if !has_attr(cx.sess(), cx.tcx.hir().attrs(arm.hir_id)) {
100100
return;
101101
}
102102
print_pat(cx, &arm.pat, 1);

0 commit comments

Comments
 (0)