@@ -600,26 +600,19 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
600600 let ty = tcx. typeck ( def_id) . node_type ( block. hir_id ) ;
601601
602602 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) ;
605604 let args = ty:: InlineConstArgs :: new ( tcx, ty:: InlineConstArgsParts { parent_args, ty } ) . args ;
606605
607- debug_assert ! ( !args. has_free_regions( ) ) ;
608-
609606 let ct = ty:: UnevaluatedConst { def : def_id. to_def_id ( ) , args } ;
610607 let c = ty:: Const :: new_unevaluated ( self . tcx , ct) ;
611608 let pattern = self . const_to_pat ( c, ty, id, span) ;
612609
613610 // Apply a type ascription for the inline constant.
614- // FIXME: reusing the `args` above causes an ICE
615611 let annotation = {
616612 let infcx = tcx. infer_ctxt ( ) . build ( TypingMode :: non_body_analysis ( ) ) ;
617613 let args = ty:: InlineConstArgs :: new (
618614 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) } ,
623616 )
624617 . args ;
625618 infcx. canonicalize_user_type_annotation ( ty:: UserType :: new ( ty:: UserTypeKind :: TypeOf (
0 commit comments