diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-08-03 20:48:52 +1000 | 
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-08-11 19:57:30 +1000 | 
| commit | 15cc0e1b5cb9cc84ce017b656a75d9954f394f03 (patch) | |
| tree | c3175395c6257de9ebe2b56a03d253de0a206563 /compiler/rustc_pattern_analysis/src | |
| parent | ed3e38f33697efd2272b2df6a31b450e1e6ee12b (diff) | |
| download | rust-15cc0e1b5cb9cc84ce017b656a75d9954f394f03.tar.gz rust-15cc0e1b5cb9cc84ce017b656a75d9954f394f03.zip | |
Remove `PatKind::Box`
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 | 5 | 
2 files changed, 1 insertions, 6 deletions
| diff --git a/compiler/rustc_pattern_analysis/src/rustc.rs b/compiler/rustc_pattern_analysis/src/rustc.rs index 1d687cc1065..91650c7531a 100644 --- a/compiler/rustc_pattern_analysis/src/rustc.rs +++ b/compiler/rustc_pattern_analysis/src/rustc.rs @@ -832,7 +832,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { Struct if pat.ty().is_box() => { // Outside of the `alloc` crate, the only way to create a struct pattern // of type `Box` is to use a `box` pattern via #[feature(box_patterns)]. - PatKind::Box { subpattern: hoist(&pat.fields[0]) } + PatKind::Print(format!("box {}", hoist(&pat.fields[0]))) } Struct | Variant(_) | UnionField => { let enum_info = match *pat.ty().kind() { diff --git a/compiler/rustc_pattern_analysis/src/rustc/print.rs b/compiler/rustc_pattern_analysis/src/rustc/print.rs index dd37cd80ad2..d03c68442cd 100644 --- a/compiler/rustc_pattern_analysis/src/rustc/print.rs +++ b/compiler/rustc_pattern_analysis/src/rustc/print.rs @@ -32,10 +32,6 @@ pub(crate) struct Pat<'tcx> { #[derive(Clone, Debug)] pub(crate) enum PatKind<'tcx> { - Box { - subpattern: Box<Pat<'tcx>>, - }, - Deref { subpattern: Box<Pat<'tcx>>, }, @@ -63,7 +59,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::Box { ref subpattern } => write!(f, "box {subpattern}"), PatKind::Deref { ref subpattern } => write_ref_like(f, self.ty, subpattern), PatKind::Constant { value } => write!(f, "{value}"), PatKind::Range(ref range) => write!(f, "{range}"), | 
