From 1e793cdad3dd6712ca2ca240ef2648ecf9078e10 Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Sun, 12 Apr 2026 21:21:56 +0200 Subject: [PATCH] Remove AttributeDuplicates from BUILTIN_ATTRIBUTES --- clippy_lints/src/cognitive_complexity.rs | 2 +- clippy_utils/src/lib.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/cognitive_complexity.rs b/clippy_lints/src/cognitive_complexity.rs index 911ca306aca4..63d9064bbc37 100644 --- a/clippy_lints/src/cognitive_complexity.rs +++ b/clippy_lints/src/cognitive_complexity.rs @@ -145,7 +145,7 @@ fn check_fn( def_id: LocalDefId, ) { #[allow(deprecated)] - if !cx.tcx.has_attr(def_id, sym::test) { + if !cx.tcx.get_attrs(def_id, sym::test).next().is_some() { let expr = if kind.asyncness().is_async() { match get_async_fn_body(cx.tcx, body) { Some(b) => b, diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index a8ff9b4cf6fb..396b63870dea 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -2400,8 +2400,7 @@ pub fn is_hir_ty_cfg_dependant(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> bool { if let TyKind::Path(QPath::Resolved(_, path)) = ty.kind && let Res::Def(_, def_id) = path.res { - #[allow(deprecated)] - return cx.tcx.has_attr(def_id, sym::cfg) || cx.tcx.has_attr(def_id, sym::cfg_attr); + return find_attr!(cx.tcx, def_id, CfgTrace(..) | CfgAttrTrace); } false }