@@ -291,7 +291,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
291291 } ,
292292 ..
293293 } ,
294- user_ty : ascription_user_ty ,
294+ user_ty : pat_ascription_ty ,
295295 user_ty_span,
296296 } => {
297297 let place =
@@ -316,7 +316,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
316316 kind : StatementKind :: AscribeUserType (
317317 place,
318318 ty:: Variance :: Invariant ,
319- box ascription_user_ty ,
319+ box pat_ascription_ty . user_ty ( ) ,
320320 ) ,
321321 } ,
322322 ) ;
@@ -491,7 +491,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
491491 pub ( super ) fn visit_bindings (
492492 & mut self ,
493493 pattern : & Pattern < ' tcx > ,
494- mut pattern_user_ty : Option < ( UserTypeAnnotation < ' tcx > , Span ) > ,
494+ mut pattern_user_ty : Option < ( PatternTypeAnnotation < ' tcx > , Span ) > ,
495495 f : & mut impl FnMut (
496496 & mut Self ,
497497 Mutability ,
@@ -500,7 +500,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
500500 NodeId ,
501501 Span ,
502502 Ty < ' tcx > ,
503- Option < ( UserTypeAnnotation < ' tcx > , Span ) > ,
503+ Option < ( PatternTypeAnnotation < ' tcx > , Span ) > ,
504504 ) ,
505505 ) {
506506 match * pattern. kind {
@@ -626,7 +626,7 @@ struct Binding<'tcx> {
626626struct Ascription < ' tcx > {
627627 span : Span ,
628628 source : Place < ' tcx > ,
629- user_ty : UserTypeAnnotation < ' tcx > ,
629+ user_ty : PatternTypeAnnotation < ' tcx > ,
630630}
631631
632632#[ derive( Clone , Debug ) ]
@@ -1323,7 +1323,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
13231323 kind : StatementKind :: AscribeUserType (
13241324 ascription. source . clone ( ) ,
13251325 ty:: Variance :: Covariant ,
1326- box ascription. user_ty ,
1326+ box ascription. user_ty . user_ty ( ) ,
13271327 ) ,
13281328 } ,
13291329 ) ;
@@ -1470,7 +1470,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
14701470 num_patterns : usize ,
14711471 var_id : NodeId ,
14721472 var_ty : Ty < ' tcx > ,
1473- user_var_ty : Option < ( UserTypeAnnotation < ' tcx > , Span ) > ,
1473+ user_var_ty : Option < ( PatternTypeAnnotation < ' tcx > , Span ) > ,
14741474 has_guard : ArmHasGuard ,
14751475 opt_match_place : Option < ( Option < Place < ' tcx > > , Span ) > ,
14761476 pat_span : Span ,
@@ -1489,7 +1489,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
14891489 let local = LocalDecl :: < ' tcx > {
14901490 mutability,
14911491 ty : var_ty,
1492- user_ty : user_var_ty,
1492+ user_ty : user_var_ty. map ( | ( pat_ty , span ) | ( pat_ty . user_ty ( ) , span ) ) ,
14931493 name : Some ( name) ,
14941494 source_info,
14951495 visibility_scope,
0 commit comments