cx,
WILDCARD_IN_OR_PATTERNS,
arm.pat.span,
- "wildcard pattern covers any other pattern as it will match anyway.",
+ "wildcard pattern covers any other pattern as it will match anyway",
None,
- "Consider handling `_` separately.",
+ "consider handling `_` separately",
);
}
}
if b0 != b1;
let if_guard = &b0_arms[0].guard;
if if_guard.is_none() || b0_arms.len() == 1;
- if b0_arms[0].attrs.is_empty();
+ if cx.tcx.hir().attrs(b0_arms[0].hir_id).is_empty();
if b0_arms[1..].iter()
.all(|arm| {
find_bool_lit(&arm.body.kind, desugared).map_or(false, |b| b == b0) &&
- arm.guard.is_none() && arm.attrs.is_empty()
+ arm.guard.is_none() && cx.tcx.hir().attrs(arm.hir_id).is_empty()
});
then {
// The suggestion may be incorrect, because some arms can have `cfg` attributes