Skip to content

Commit 15cc0e1

Browse files
committed
Remove PatKind::Box
1 parent ed3e38f commit 15cc0e1

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

compiler/rustc_pattern_analysis/src/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> {
832832
Struct if pat.ty().is_box() => {
833833
// Outside of the `alloc` crate, the only way to create a struct pattern
834834
// of type `Box` is to use a `box` pattern via #[feature(box_patterns)].
835-
PatKind::Box { subpattern: hoist(&pat.fields[0]) }
835+
PatKind::Print(format!("box {}", hoist(&pat.fields[0])))
836836
}
837837
Struct | Variant(_) | UnionField => {
838838
let enum_info = match *pat.ty().kind() {

compiler/rustc_pattern_analysis/src/rustc/print.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ pub(crate) struct Pat<'tcx> {
3232

3333
#[derive(Clone, Debug)]
3434
pub(crate) enum PatKind<'tcx> {
35-
Box {
36-
subpattern: Box<Pat<'tcx>>,
37-
},
38-
3935
Deref {
4036
subpattern: Box<Pat<'tcx>>,
4137
},
@@ -63,7 +59,6 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
6359
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
6460
match self.kind {
6561
PatKind::Never => write!(f, "!"),
66-
PatKind::Box { ref subpattern } => write!(f, "box {subpattern}"),
6762
PatKind::Deref { ref subpattern } => write_ref_like(f, self.ty, subpattern),
6863
PatKind::Constant { value } => write!(f, "{value}"),
6964
PatKind::Range(ref range) => write!(f, "{range}"),

0 commit comments

Comments
 (0)