Skip to content

Commit 2b6f438

Browse files
committed
Remove PatKind::Range
1 parent 9952e4d commit 2b6f438

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

compiler/rustc_pattern_analysis/src/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> {
807807
range.hi
808808
};
809809
let hi = cx.hoist_pat_range_bdy(hi, ty);
810-
PatKind::Range(Box::new(PatRange { lo, hi, end, ty: ty.inner() }))
810+
PatKind::Print(PatRange { lo, hi, end, ty: ty.inner() }.to_string())
811811
};
812812

813813
Pat { ty: ty.inner(), kind }

compiler/rustc_pattern_analysis/src/rustc/print.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use std::fmt;
1313

1414
use rustc_middle::bug;
15-
use rustc_middle::thir::PatRange;
1615
use rustc_middle::ty::{self, AdtDef, Ty, TyCtxt};
1716
use rustc_span::sym;
1817
use rustc_target::abi::{FieldIdx, VariantIdx};
@@ -33,8 +32,6 @@ pub(crate) struct Pat<'tcx> {
3332

3433
#[derive(Clone, Debug)]
3534
pub(crate) enum PatKind<'tcx> {
36-
Range(Box<PatRange<'tcx>>),
37-
3835
Slice {
3936
prefix: Box<[Box<Pat<'tcx>>]>,
4037
/// True if this slice-like pattern should include a `..` between the
@@ -52,7 +49,6 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
5249
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5350
match self.kind {
5451
PatKind::Never => write!(f, "!"),
55-
PatKind::Range(ref range) => write!(f, "{range}"),
5652
PatKind::Slice { ref prefix, has_dot_dot, ref suffix } => {
5753
write_slice_like(f, prefix, has_dot_dot, suffix)
5854
}

0 commit comments

Comments
 (0)