Rollup merge of #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: #87121 r? ``@Nadrieril``
This commit is contained in:
commit
66dd172961
1 changed files with 1 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue