diff options
| author | Jules Bertholet <julesbertholet@quoi.xyz> | 2024-07-05 11:16:48 -0400 |
|---|---|---|
| committer | Jules Bertholet <julesbertholet@quoi.xyz> | 2024-07-05 11:17:13 -0400 |
| commit | 5a35fc446e173d7a592bb859ffda9d97e996df5b (patch) | |
| tree | 332c5cd69801f4584057c4afbaa827f52323b333 /compiler | |
| parent | 5fd5b650935c27754dcf8cef06df37c3b91818eb (diff) | |
Match ergonomics 2024: `&` matches `&mut` on old editions
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_hir_typeck/src/pat.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_hir_typeck/src/pat.rs b/compiler/rustc_hir_typeck/src/pat.rs index c8db4b97bae..5e0f37ed792 100644 --- a/compiler/rustc_hir_typeck/src/pat.rs +++ b/compiler/rustc_hir_typeck/src/pat.rs @@ -2217,7 +2217,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { debug!("check_pat_ref: expected={:?}", expected); match *expected.kind() { ty::Ref(_, r_ty, r_mutbl) - if (new_match_ergonomics && r_mutbl >= pat_mutbl) + if (no_ref_mut_behind_and && r_mutbl >= pat_mutbl) || r_mutbl == pat_mutbl => { if no_ref_mut_behind_and && r_mutbl == Mutability::Not { |
