@@ -135,7 +135,7 @@ fn get_impl_trait_def_id(cx: &LateContext<'_>, method_def_id: LocalDefId) -> Opt
135135 } ) ,
136136 ) ) = cx. tcx . hir_parent_iter ( hir_id) . next ( )
137137 // We exclude `impl` blocks generated from rustc's proc macros.
138- && !cx. tcx . has_attr ( * owner_id, sym :: automatically_derived )
138+ && !cx. tcx . is_automatically_derived ( owner_id. to_def_id ( ) )
139139 // It is a implementation of a trait.
140140 && let Some ( trait_) = impl_. of_trait
141141 {
@@ -240,7 +240,7 @@ fn check_to_string(cx: &LateContext<'_>, method_span: Span, method_def_id: Local
240240 } ) ,
241241 ) ) = cx. tcx . hir_parent_iter ( hir_id) . next ( )
242242 // We exclude `impl` blocks generated from rustc's proc macros.
243- && !cx. tcx . has_attr ( * owner_id, sym :: automatically_derived )
243+ && !cx. tcx . is_automatically_derived ( owner_id. to_def_id ( ) )
244244 // It is a implementation of a trait.
245245 && let Some ( trait_) = impl_. of_trait
246246 && let Some ( trait_def_id) = trait_. trait_def_id ( )
@@ -337,7 +337,7 @@ impl UnconditionalRecursion {
337337 for ( ty, impl_def_ids) in impls. non_blanket_impls ( ) {
338338 let Some ( self_def_id) = ty. def ( ) else { continue } ;
339339 for impl_def_id in impl_def_ids {
340- if !cx. tcx . has_attr ( * impl_def_id, sym :: automatically_derived ) &&
340+ if !cx. tcx . is_automatically_derived ( * impl_def_id) &&
341341 let Some ( assoc_item) = cx
342342 . tcx
343343 . associated_items ( impl_def_id)
0 commit comments