Skip to content

Commit 1e793cd

Browse files
Remove AttributeDuplicates from BUILTIN_ATTRIBUTES
1 parent 0e4b612 commit 1e793cd

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

clippy_lints/src/cognitive_complexity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl<'tcx> LateLintPass<'tcx> for CognitiveComplexity {
145145
def_id: LocalDefId,
146146
) {
147147
#[allow(deprecated)]
148-
if !cx.tcx.has_attr(def_id, sym::test) {
148+
if !cx.tcx.get_attrs(def_id, sym::test).next().is_some() {
149149
let expr = if kind.asyncness().is_async() {
150150
match get_async_fn_body(cx.tcx, body) {
151151
Some(b) => b,

clippy_utils/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,8 +2400,7 @@ pub fn is_hir_ty_cfg_dependant(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> bool {
24002400
if let TyKind::Path(QPath::Resolved(_, path)) = ty.kind
24012401
&& let Res::Def(_, def_id) = path.res
24022402
{
2403-
#[allow(deprecated)]
2404-
return cx.tcx.has_attr(def_id, sym::cfg) || cx.tcx.has_attr(def_id, sym::cfg_attr);
2403+
return find_attr!(cx.tcx, def_id, CfgTrace(..) | CfgAttrTrace);
24052404
}
24062405
false
24072406
}

0 commit comments

Comments
 (0)