@@ -98,7 +98,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
98
98
def_bm = match def_bm {
99
99
// If default binding mode is by value, make it `ref` or `ref mut`
100
100
// (depending on whether we observe `&` or `&mut`).
101
- ty:: BindByValue ( _ ) =>
101
+ ty:: BindByValue { .. } =>
102
102
ty:: BindByReference ( inner_mutability) ,
103
103
104
104
// Once a `ref`, always a `ref`. This is because a `& &mut` can't mutate
@@ -132,7 +132,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
132
132
// ```
133
133
//
134
134
// cc #46688
135
- def_bm = ty:: BindByValue ( hir:: MutImmutable ) ;
135
+ def_bm = ty:: BindByValue { mutability : hir:: MutImmutable , coerced : false } ;
136
136
}
137
137
138
138
// Lose mutability now that we know binding mode and discriminant type.
@@ -256,7 +256,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
256
256
self . demand_eqtype_pat ( pat. span , region_ty, local_ty, match_discrim_span) ;
257
257
}
258
258
// otherwise the type of x is the expected type T
259
- ty:: BindByValue ( _ ) => {
259
+ ty:: BindByValue { .. } => {
260
260
// As above, `T <: typeof(x)` is required but we
261
261
// use equality, see (*) below.
262
262
self . demand_eqtype_pat ( pat. span , expected, local_ty, match_discrim_span) ;
@@ -648,7 +648,9 @@ https://doc.rust-lang.org/reference/types.html#trait-objects");
648
648
self . check_pat_walk (
649
649
& p,
650
650
discrim_ty,
651
- ty:: BindingMode :: BindByValue ( hir:: Mutability :: MutImmutable ) ,
651
+ ty:: BindingMode :: BindByValue {
652
+ mutability : hir:: Mutability :: MutImmutable , coerced : false
653
+ } ,
652
654
Some ( discrim. span ) ,
653
655
) ;
654
656
all_pats_diverge &= self . diverges . get ( ) ;
0 commit comments