@@ -835,7 +835,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
835
835
self . add_rust_2024_migration_desugared_pat (
836
836
pat_info. top_info . hir_id ,
837
837
pat,
838
- 't' ,
838
+ 't' , // last char of `mut`
839
839
def_br_mutbl,
840
840
) ;
841
841
BindingMode ( ByRef :: No , Mutability :: Mut )
@@ -848,7 +848,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
848
848
self . add_rust_2024_migration_desugared_pat (
849
849
pat_info. top_info . hir_id ,
850
850
pat,
851
- if user_br_mutbl. is_mut ( ) { 't' } else { 'f' } ,
851
+ match user_br_mutbl {
852
+ Mutability :: Not => 'f' , // last char of `ref`
853
+ Mutability :: Mut => 't' , // last char of `ref mut`
854
+ } ,
852
855
def_br_mutbl,
853
856
) ;
854
857
}
@@ -2387,7 +2390,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
2387
2390
self . add_rust_2024_migration_desugared_pat (
2388
2391
pat_info. top_info . hir_id ,
2389
2392
pat,
2390
- if pat_mutbl. is_mut ( ) { 't' } else { '&' } ,
2393
+ match pat_mutbl {
2394
+ Mutability :: Not => '&' , // last char of `&`
2395
+ Mutability :: Mut => 't' , // last char of `&mut`
2396
+ } ,
2391
2397
inh_mut,
2392
2398
)
2393
2399
}
0 commit comments