@@ -27,19 +27,11 @@ pub(crate) struct FieldPat<'tcx> {
27
27
pub ( crate ) struct Pat < ' tcx > {
28
28
#[ allow( dead_code) ]
29
29
pub ( crate ) ty : Ty < ' tcx > ,
30
- pub ( crate ) kind : PatKind < ' tcx > ,
30
+ pub ( crate ) kind : PatKind ,
31
31
}
32
32
33
33
#[ derive( Clone , Debug ) ]
34
- pub ( crate ) enum PatKind < ' tcx > {
35
- Slice {
36
- prefix : Box < [ Box < Pat < ' tcx > > ] > ,
37
- /// True if this slice-like pattern should include a `..` between the
38
- /// prefix and suffix.
39
- has_dot_dot : bool ,
40
- suffix : Box < [ Box < Pat < ' tcx > > ] > ,
41
- } ,
42
-
34
+ pub ( crate ) enum PatKind {
43
35
Never ,
44
36
45
37
Print ( String ) ,
@@ -49,9 +41,6 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
49
41
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
50
42
match self . kind {
51
43
PatKind :: Never => write ! ( f, "!" ) ,
52
- PatKind :: Slice { ref prefix, has_dot_dot, ref suffix } => {
53
- write_slice_like ( f, prefix, has_dot_dot, suffix)
54
- }
55
44
PatKind :: Print ( ref string) => write ! ( f, "{string}" ) ,
56
45
}
57
46
}
@@ -173,7 +162,7 @@ pub(crate) fn write_ref_like<'tcx>(
173
162
write ! ( f, "{subpattern}" )
174
163
}
175
164
176
- fn write_slice_like < ' tcx > (
165
+ pub ( crate ) fn write_slice_like < ' tcx > (
177
166
f : & mut impl fmt:: Write ,
178
167
prefix : & [ Box < Pat < ' tcx > > ] ,
179
168
has_dot_dot : bool ,
0 commit comments