@@ -291,7 +291,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
291
291
} ,
292
292
..
293
293
} ,
294
- user_ty : ascription_user_ty ,
294
+ user_ty : pat_ascription_ty ,
295
295
user_ty_span,
296
296
} => {
297
297
let place =
@@ -316,7 +316,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
316
316
kind : StatementKind :: AscribeUserType (
317
317
place,
318
318
ty:: Variance :: Invariant ,
319
- box ascription_user_ty ,
319
+ box pat_ascription_ty . user_ty ( ) ,
320
320
) ,
321
321
} ,
322
322
) ;
@@ -491,7 +491,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
491
491
pub ( super ) fn visit_bindings (
492
492
& mut self ,
493
493
pattern : & Pattern < ' tcx > ,
494
- mut pattern_user_ty : Option < ( UserTypeAnnotation < ' tcx > , Span ) > ,
494
+ mut pattern_user_ty : Option < ( PatternTypeAnnotation < ' tcx > , Span ) > ,
495
495
f : & mut impl FnMut (
496
496
& mut Self ,
497
497
Mutability ,
@@ -500,7 +500,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
500
500
NodeId ,
501
501
Span ,
502
502
Ty < ' tcx > ,
503
- Option < ( UserTypeAnnotation < ' tcx > , Span ) > ,
503
+ Option < ( PatternTypeAnnotation < ' tcx > , Span ) > ,
504
504
) ,
505
505
) {
506
506
match * pattern. kind {
@@ -626,7 +626,7 @@ struct Binding<'tcx> {
626
626
struct Ascription < ' tcx > {
627
627
span : Span ,
628
628
source : Place < ' tcx > ,
629
- user_ty : UserTypeAnnotation < ' tcx > ,
629
+ user_ty : PatternTypeAnnotation < ' tcx > ,
630
630
}
631
631
632
632
#[ derive( Clone , Debug ) ]
@@ -1323,7 +1323,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
1323
1323
kind : StatementKind :: AscribeUserType (
1324
1324
ascription. source . clone ( ) ,
1325
1325
ty:: Variance :: Covariant ,
1326
- box ascription. user_ty ,
1326
+ box ascription. user_ty . user_ty ( ) ,
1327
1327
) ,
1328
1328
} ,
1329
1329
) ;
@@ -1470,7 +1470,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
1470
1470
num_patterns : usize ,
1471
1471
var_id : NodeId ,
1472
1472
var_ty : Ty < ' tcx > ,
1473
- user_var_ty : Option < ( UserTypeAnnotation < ' tcx > , Span ) > ,
1473
+ user_var_ty : Option < ( PatternTypeAnnotation < ' tcx > , Span ) > ,
1474
1474
has_guard : ArmHasGuard ,
1475
1475
opt_match_place : Option < ( Option < Place < ' tcx > > , Span ) > ,
1476
1476
pat_span : Span ,
@@ -1489,7 +1489,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
1489
1489
let local = LocalDecl :: < ' tcx > {
1490
1490
mutability,
1491
1491
ty : var_ty,
1492
- user_ty : user_var_ty,
1492
+ user_ty : user_var_ty. map ( | ( pat_ty , span ) | ( pat_ty . user_ty ( ) , span ) ) ,
1493
1493
name : Some ( name) ,
1494
1494
source_info,
1495
1495
visibility_scope,
0 commit comments