diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-08-03 20:59:02 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-08-11 19:57:30 +1000 |
| commit | 2b6f4386ebdedd62a093577dafe5082e4f63b316 (patch) | |
| tree | ec6d4b75d23e47d77744565b0c0803f9d86c91dd /compiler/rustc_pattern_analysis/src | |
| parent | 9952e4d4c8ba5def2861e1a39af61506f0a91655 (diff) | |
| download | rust-2b6f4386ebdedd62a093577dafe5082e4f63b316.tar.gz rust-2b6f4386ebdedd62a093577dafe5082e4f63b316.zip | |
Remove `PatKind::Range`
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/rustc.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/rustc/print.rs | 4 |
2 files changed, 1 insertions, 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<PatRange<'tcx>>), - Slice { prefix: Box<[Box<Pat<'tcx>>]>, /// 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) } |
