@@ -567,15 +567,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
567
567
// Lower the named constant to a THIR pattern.
568
568
let args = self . typeck_results . node_args ( id) ;
569
569
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) ;
579
571
580
572
// If this is an associated constant with an explicit user-written
581
573
// type, add an ascription node (e.g. `<Foo<'a> as MyTrait>::CONST`).
@@ -619,11 +611,8 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
619
611
debug_assert ! ( !args. has_free_regions( ) ) ;
620
612
621
613
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
627
616
}
628
617
629
618
/// Lowers the kinds of "expression" that can appear in a HIR pattern:
0 commit comments