only query params_in_repr if def kind is adt

This commit is contained in:
bohan
2024-10-02 17:36:31 +08:00
parent 9e3e517446
commit e9b2d09ad7
5 changed files with 45 additions and 6 deletions

View File

@@ -358,7 +358,7 @@ fn find_item_ty_spans(
match ty.kind {
hir::TyKind::Path(hir::QPath::Resolved(_, path)) => {
if let Res::Def(kind, def_id) = path.res
&& !matches!(kind, DefKind::TyAlias)
&& matches!(kind, DefKind::Enum | DefKind::Struct | DefKind::Union)
{
let check_params = def_id.as_local().map_or(true, |def_id| {
if def_id == needle {