Skip to content

Commit a4640f4

Browse files
Simplify calc_default_binding_mode
1 parent 84ed100 commit a4640f4

File tree

1 file changed

+1
-2
lines changed
  • compiler/rustc_hir_typeck/src

1 file changed

+1
-2
lines changed

compiler/rustc_hir_typeck/src/pat.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
308308
AdjustMode::ResetAndConsumeRef(ref_pat_mutbl) => {
309309
let mutbls_match = def_bm.0 == ByRef::Yes(ref_pat_mutbl);
310310
if pat.span.at_least_rust_2024() && self.tcx.features().ref_pat_eat_one_layer_2024 {
311-
let max_ref_mutbl = cmp::min(max_ref_mutbl, ref_pat_mutbl);
312311
if mutbls_match {
313312
debug!("consuming inherited reference");
314-
(expected, INITIAL_BM, max_ref_mutbl, true)
313+
(expected, INITIAL_BM, cmp::min(max_ref_mutbl, ref_pat_mutbl), true)
315314
} else {
316315
let (new_ty, new_bm, max_ref_mutbl) = if ref_pat_mutbl == Mutability::Mut {
317316
self.peel_off_references(

0 commit comments

Comments
 (0)