From 2b6f4386ebdedd62a093577dafe5082e4f63b316 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Sat, 3 Aug 2024 20:59:02 +1000 Subject: [PATCH] Remove `PatKind::Range` --- compiler/rustc_pattern_analysis/src/rustc.rs | 2 +- compiler/rustc_pattern_analysis/src/rustc/print.rs | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/rustc_pattern_analysis/src/rustc.rs b/compiler/rustc_pattern_analysis/src/rustc.rs index 9bd17b822af..d7c14348b1b 100644 --- a/compiler/rustc_pattern_analysis/src/rustc.rs +++ b/compiler/rustc_pattern_analysis/src/rustc.rs @@ -807,7 +807,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { range.hi }; let hi = cx.hoist_pat_range_bdy(hi, ty); - PatKind::Range(Box::new(PatRange { lo, hi, end, ty: ty.inner() })) + PatKind::Print(PatRange { lo, hi, end, ty: ty.inner() }.to_string()) }; Pat { ty: ty.inner(), kind } diff --git a/compiler/rustc_pattern_analysis/src/rustc/print.rs b/compiler/rustc_pattern_analysis/src/rustc/print.rs index 9e24ef58e8b..fab71b421f8 100644 --- a/compiler/rustc_pattern_analysis/src/rustc/print.rs +++ b/compiler/rustc_pattern_analysis/src/rustc/print.rs @@ -12,7 +12,6 @@ use std::fmt; use rustc_middle::bug; -use rustc_middle::thir::PatRange; use rustc_middle::ty::{self, AdtDef, Ty, TyCtxt}; use rustc_span::sym; use rustc_target::abi::{FieldIdx, VariantIdx}; @@ -33,8 +32,6 @@ pub(crate) struct Pat<'tcx> { #[derive(Clone, Debug)] pub(crate) enum PatKind<'tcx> { - Range(Box>), - Slice { prefix: Box<[Box>]>, /// True if this slice-like pattern should include a `..` between the @@ -52,7 +49,6 @@ impl<'tcx> fmt::Display for Pat<'tcx> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.kind { PatKind::Never => write!(f, "!"), - PatKind::Range(ref range) => write!(f, "{range}"), PatKind::Slice { ref prefix, has_dot_dot, ref suffix } => { write_slice_like(f, prefix, has_dot_dot, suffix) }