Skip to content

Commit 30e8adb

Browse files
committed
Use has_attr instead of get_attrs in has_must_use_attr
1 parent 1421cff commit 30e8adb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_lint/src/let_underscore.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,5 @@ fn is_must_use_func_call(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> bool {
259259

260260
// returns true if DefId contains a `#[must_use]` attribute
261261
fn has_must_use_attr(cx: &LateContext<'_>, did: hir::def_id::DefId) -> bool {
262-
cx.tcx
263-
.get_attrs(did, rustc_span::sym::must_use)
264-
.find(|a| a.has_name(rustc_span::sym::must_use))
265-
.is_some()
262+
cx.tcx.has_attr(did, rustc_span::sym::must_use)
266263
}

0 commit comments

Comments
 (0)