@@ -620,32 +620,8 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
620
620
) -> PatKind<'tcx> {
621
621
let tcx = self.tcx;
622
622
let def_id = block.def_id;
623
- let body_id = block.body;
624
- let expr = &tcx.hir().body(body_id).value;
625
623
let ty = tcx.typeck(def_id).node_type(block.hir_id);
626
624
627
- // Special case inline consts that are just literals. This is solely
628
- // a performance optimization, as we could also just go through the regular
629
- // const eval path below.
630
- // FIXME: investigate the performance impact of removing this.
631
- let lit_input = match expr.kind {
632
- hir::ExprKind::Lit(lit) => Some(LitToConstInput { lit: &lit.node, ty, neg: false }),
633
- hir::ExprKind::Unary(hir::UnOp::Neg, expr) => match expr.kind {
634
- hir::ExprKind::Lit(lit) => Some(LitToConstInput { lit: &lit.node, ty, neg: true }),
635
- _ => None,
636
- },
637
- _ => None,
638
- };
639
- if let Some(lit_input) = lit_input {
640
- match tcx.at(expr.span).lit_to_const(lit_input) {
641
- Ok(c) => return self.const_to_pat(c, ty, id, span).kind,
642
- // If an error occurred, ignore that it's a literal
643
- // and leave reporting the error up to const eval of
644
- // the unevaluated constant below.
645
- Err(_) => {}
646
- }
647
- }
648
-
649
625
let typeck_root_def_id = tcx.typeck_root_def_id(def_id.to_def_id());
650
626
let parent_args =
651
627
tcx.erase_regions(ty::GenericArgs::identity_for_item(tcx, typeck_root_def_id));
0 commit comments