@@ -553,22 +553,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
553
553
pat_adjustments. push ( expected) ;
554
554
555
555
expected = inner_ty;
556
- def_bm = match def_bm {
556
+ def_bm = ty :: BindByReference ( match def_bm {
557
557
// If default binding mode is by value, make it `ref` or `ref mut`
558
558
// (depending on whether we observe `&` or `&mut`).
559
- ty:: BindByValue ( _) =>
560
- ty:: BindByReference ( inner_mutability) ,
561
-
562
- // Once a `ref`, always a `ref`. This is because a `& &mut` can't mutate
563
- // the underlying value.
564
- ty:: BindByReference ( hir:: Mutability :: MutImmutable ) =>
565
- ty:: BindByReference ( hir:: Mutability :: MutImmutable ) ,
566
-
567
- // When `ref mut`, stay a `ref mut` (on `&mut`) or downgrade to `ref`
568
- // (on `&`).
569
- ty:: BindByReference ( hir:: Mutability :: MutMutable ) =>
570
- ty:: BindByReference ( inner_mutability) ,
571
- } ;
559
+ ty:: BindByValue ( _) |
560
+ // When `ref mut`, stay a `ref mut` (on `&mut`) or downgrade to `ref` (on `&`).
561
+ ty:: BindByReference ( hir:: Mutability :: MutMutable ) => inner_mutability,
562
+ // Once a `ref`, always a `ref`.
563
+ // This is because a `& &mut` cannot mutate the underlying value.
564
+ ty:: BindByReference ( m @ hir:: Mutability :: MutImmutable ) => m,
565
+ } ) ;
572
566
}
573
567
574
568
if pat_adjustments. len ( ) > 0 {
0 commit comments