@@ -600,26 +600,19 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
600
600
let ty = tcx. typeck ( def_id) . node_type ( block. hir_id ) ;
601
601
602
602
let typeck_root_def_id = tcx. typeck_root_def_id ( def_id. to_def_id ( ) ) ;
603
- let parent_args =
604
- tcx. erase_regions ( ty:: GenericArgs :: identity_for_item ( tcx, typeck_root_def_id) ) ;
603
+ let parent_args = ty:: GenericArgs :: identity_for_item ( tcx, typeck_root_def_id) ;
605
604
let args = ty:: InlineConstArgs :: new ( tcx, ty:: InlineConstArgsParts { parent_args, ty } ) . args ;
606
605
607
- debug_assert ! ( !args. has_free_regions( ) ) ;
608
-
609
606
let ct = ty:: UnevaluatedConst { def : def_id. to_def_id ( ) , args } ;
610
607
let c = ty:: Const :: new_unevaluated ( self . tcx , ct) ;
611
608
let pattern = self . const_to_pat ( c, ty, id, span) ;
612
609
613
610
// Apply a type ascription for the inline constant.
614
- // FIXME: reusing the `args` above causes an ICE
615
611
let annotation = {
616
612
let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
617
613
let args = ty:: InlineConstArgs :: new (
618
614
tcx,
619
- ty:: InlineConstArgsParts {
620
- parent_args : ty:: GenericArgs :: identity_for_item ( tcx, typeck_root_def_id) ,
621
- ty : infcx. next_ty_var ( span) ,
622
- } ,
615
+ ty:: InlineConstArgsParts { parent_args, ty : infcx. next_ty_var ( span) } ,
623
616
)
624
617
. args ;
625
618
infcx. canonicalize_user_type_annotation ( ty:: UserType :: new ( ty:: UserTypeKind :: TypeOf (
0 commit comments