Skip to content

Commit 66dd172

Browse files
authored
Rollup merge of rust-lang#138528 - dianne:implicit-deref-patterns, r=Nadrieril
deref patterns: implement implicit deref patterns This implements implicit deref patterns (per https://hackmd.io/4qDDMcvyQ-GDB089IPcHGg#Implicit-deref-patterns) and adds tests and an unstable book chapter. Best reviewed commit-by-commit. Overall there's a lot of additions, but a lot of that is tests, documentation, and simple(?) refactoring. Tracking issue: rust-lang#87121 r? ``@Nadrieril``
2 parents 4d47d7f + 5aa44a8 commit 66dd172

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/pattern_type_mismatch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ fn find_first_mismatch(cx: &LateContext<'_>, pat: &Pat<'_>) -> Option<(Span, Mut
179179
};
180180
if let Some(adjustments) = cx.typeck_results().pat_adjustments().get(adjust_pat.hir_id) {
181181
if let [first, ..] = **adjustments {
182-
if let ty::Ref(.., mutability) = *first.kind() {
182+
if let ty::Ref(.., mutability) = *first.source.kind() {
183183
let level = if p.hir_id == pat.hir_id {
184184
Level::Top
185185
} else {

0 commit comments

Comments
 (0)