Skip to content

Commit

Permalink
Lower anonymous structs or unions to HIR
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-king committed Feb 12, 2024
1 parent 036d00b commit 05101ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions clippy_lints/src/dereference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ impl TyCoercionStability {
| TyKind::Typeof(..)
| TyKind::TraitObject(..)
| TyKind::InferDelegation(..)
| TyKind::AnonAdt(..)
| TyKind::Err(_) => Self::Reborrow,
};
}
Expand Down
3 changes: 2 additions & 1 deletion clippy_utils/src/hir_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ impl HirEqInterExpr<'_, '_, '_> {
(TyKind::Path(l), TyKind::Path(r)) => self.eq_qpath(l, r),
(&TyKind::Tup(l), &TyKind::Tup(r)) => over(l, r, |l, r| self.eq_ty(l, r)),
(&TyKind::Infer, &TyKind::Infer) => true,
(TyKind::AnonAdt(l_item_id), TyKind::AnonAdt(r_item_id)) => l_item_id == r_item_id,
_ => false,
}
}
Expand Down Expand Up @@ -1108,7 +1109,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
TyKind::Typeof(anon_const) => {
self.hash_body(anon_const.body);
},
TyKind::Err(_) | TyKind::Infer | TyKind::Never | TyKind::InferDelegation(..) => {},
TyKind::Err(_) | TyKind::Infer | TyKind::Never | TyKind::InferDelegation(..) | TyKind::AnonAdt(_) => {},
}
}

Expand Down

0 comments on commit 05101ff

Please sign in to comment.