@@ -567,15 +567,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
567567 // Lower the named constant to a THIR pattern.
568568 let args = self . typeck_results . node_args ( id) ;
569569 let c = ty:: Const :: new_unevaluated ( self . tcx , ty:: UnevaluatedConst { def : def_id, args } ) ;
570- let subpattern = self . const_to_pat ( c, ty, id, span) ;
571-
572- // Wrap the pattern in a marker node to indicate that it is the result
573- // of lowering a named constant. This marker is used for improved
574- // diagnostics in some situations, but has no effect at runtime.
575- let mut pattern = {
576- let kind = PatKind :: ExpandedConstant { subpattern, def_id, is_inline : false } ;
577- Box :: new ( Pat { span, ty, kind } )
578- } ;
570+ let mut pattern = self . const_to_pat ( c, ty, id, span) ;
579571
580572 // If this is an associated constant with an explicit user-written
581573 // type, add an ascription node (e.g. `<Foo<'a> as MyTrait>::CONST`).
@@ -619,11 +611,8 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
619611 debug_assert ! ( !args. has_free_regions( ) ) ;
620612
621613 let ct = ty:: UnevaluatedConst { def : def_id. to_def_id ( ) , args } ;
622- let subpattern = self . const_to_pat ( ty:: Const :: new_unevaluated ( self . tcx , ct) , ty, id, span) ;
623-
624- // Wrap the pattern in a marker node to indicate that it is the result
625- // of lowering an inline const block.
626- PatKind :: ExpandedConstant { subpattern, def_id : def_id. to_def_id ( ) , is_inline : true }
614+ let c = ty:: Const :: new_unevaluated ( self . tcx , ct) ;
615+ self . const_to_pat ( c, ty, id, span) . kind
627616 }
628617
629618 /// Lowers the kinds of "expression" that can appear in a HIR pattern:
0 commit comments