store the kind of pattern adjustments in pat_adjustments

This allows us to better distinguish builtin and overloaded implicit
dereferences.
This commit is contained in:
dianne 2025-03-14 18:56:15 -07:00
parent 328b4fa9fe
commit 5aa44a8550

View file

@ -179,7 +179,7 @@ fn find_first_mismatch(cx: &LateContext<'_>, pat: &Pat<'_>) -> Option<(Span, Mut
};
if let Some(adjustments) = cx.typeck_results().pat_adjustments().get(adjust_pat.hir_id) {
if let [first, ..] = **adjustments {
if let ty::Ref(.., mutability) = *first.kind() {
if let ty::Ref(.., mutability) = *first.source.kind() {
let level = if p.hir_id == pat.hir_id {
Level::Top
} else {