Skip to content

Commit 7823aac

Browse files
author
The Miri Cronjob Bot
committed
Merge from rustc
2 parents 461572a + f4b827a commit 7823aac

File tree

5 files changed

+513
-4
lines changed

5 files changed

+513
-4
lines changed

clippy_lints/src/format_args.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use rustc_span::edition::Edition::Edition2021;
3030
use rustc_span::{Span, Symbol, sym};
3131
use rustc_trait_selection::infer::TyCtxtInferExt;
3232
use rustc_trait_selection::traits::{Obligation, ObligationCause, Selection, SelectionContext};
33+
use rustc_attr_data_structures::{AttributeKind, find_attr};
3334

3435
declare_clippy_lint! {
3536
/// ### What it does
@@ -656,7 +657,7 @@ impl<'tcx> FormatArgsExpr<'_, 'tcx> {
656657
};
657658
let selection = SelectionContext::new(&infcx).select(&obligation);
658659
let derived = if let Ok(Some(Selection::UserDefined(data))) = selection {
659-
tcx.has_attr(data.impl_def_id, sym::automatically_derived)
660+
find_attr!(tcx.get_all_attrs(data.impl_def_id), AttributeKind::AutomaticallyDerived(..))
660661
} else {
661662
false
662663
};

clippy_lints_internal/src/derive_deserialize_allowing_unknown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl<'tcx> LateLintPass<'tcx> for DeriveDeserializeAllowingUnknown {
8888
}
8989

9090
// Is it derived?
91-
if !cx.tcx.has_attr(item.owner_id, sym::automatically_derived) {
91+
if !find_attr!(cx.tcx.get_all_attrs(item.owner_id), AttributeKind::AutomaticallyDerived(..)) {
9292
return;
9393
}
9494

0 commit comments

Comments
 (0)