@@ -37,11 +37,11 @@ pub struct DeconstructedPat<'p, 'tcx> {
3737}
3838
3939impl < ' p , ' tcx > DeconstructedPat < ' p , ' tcx > {
40- pub ( super ) fn wildcard ( ty : Ty < ' tcx > , span : Span ) -> Self {
40+ pub fn wildcard ( ty : Ty < ' tcx > , span : Span ) -> Self {
4141 Self :: new ( Wildcard , & [ ] , ty, span)
4242 }
4343
44- pub ( super ) fn new (
44+ pub fn new (
4545 ctor : Constructor < ' tcx > ,
4646 fields : & ' p [ DeconstructedPat < ' p , ' tcx > ] ,
4747 ty : Ty < ' tcx > ,
@@ -50,11 +50,11 @@ impl<'p, 'tcx> DeconstructedPat<'p, 'tcx> {
5050 DeconstructedPat { ctor, fields, ty, span, useful : Cell :: new ( false ) }
5151 }
5252
53- pub ( super ) fn is_or_pat ( & self ) -> bool {
53+ pub ( crate ) fn is_or_pat ( & self ) -> bool {
5454 matches ! ( self . ctor, Or )
5555 }
5656 /// Expand this (possibly-nested) or-pattern into its alternatives.
57- pub ( super ) fn flatten_or_pat ( & ' p self ) -> SmallVec < [ & ' p Self ; 1 ] > {
57+ pub ( crate ) fn flatten_or_pat ( & ' p self ) -> SmallVec < [ & ' p Self ; 1 ] > {
5858 if self . is_or_pat ( ) {
5959 self . iter_fields ( ) . flat_map ( |p| p. flatten_or_pat ( ) ) . collect ( )
6060 } else {
@@ -80,7 +80,7 @@ impl<'p, 'tcx> DeconstructedPat<'p, 'tcx> {
8080
8181 /// Specialize this pattern with a constructor.
8282 /// `other_ctor` can be different from `self.ctor`, but must be covered by it.
83- pub ( super ) fn specialize < ' a > (
83+ pub ( crate ) fn specialize < ' a > (
8484 & ' a self ,
8585 pcx : & PatCtxt < ' _ , ' p , ' tcx > ,
8686 other_ctor : & Constructor < ' tcx > ,
@@ -122,10 +122,10 @@ impl<'p, 'tcx> DeconstructedPat<'p, 'tcx> {
122122
123123 /// We keep track for each pattern if it was ever useful during the analysis. This is used
124124 /// with `redundant_spans` to report redundant subpatterns arising from or patterns.
125- pub ( super ) fn set_useful ( & self ) {
125+ pub ( crate ) fn set_useful ( & self ) {
126126 self . useful . set ( true )
127127 }
128- pub ( super ) fn is_useful ( & self ) -> bool {
128+ pub ( crate ) fn is_useful ( & self ) -> bool {
129129 if self . useful . get ( ) {
130130 true
131131 } else if self . is_or_pat ( ) && self . iter_fields ( ) . any ( |f| f. is_useful ( ) ) {
@@ -140,7 +140,7 @@ impl<'p, 'tcx> DeconstructedPat<'p, 'tcx> {
140140 }
141141
142142 /// Report the spans of subpatterns that were not useful, if any.
143- pub ( super ) fn redundant_spans ( & self ) -> Vec < Span > {
143+ pub ( crate ) fn redundant_spans ( & self ) -> Vec < Span > {
144144 let mut spans = Vec :: new ( ) ;
145145 self . collect_redundant_spans ( & mut spans) ;
146146 spans
@@ -175,17 +175,17 @@ pub struct WitnessPat<'tcx> {
175175}
176176
177177impl < ' tcx > WitnessPat < ' tcx > {
178- pub ( super ) fn new ( ctor : Constructor < ' tcx > , fields : Vec < Self > , ty : Ty < ' tcx > ) -> Self {
178+ pub ( crate ) fn new ( ctor : Constructor < ' tcx > , fields : Vec < Self > , ty : Ty < ' tcx > ) -> Self {
179179 Self { ctor, fields, ty }
180180 }
181- pub ( super ) fn wildcard ( ty : Ty < ' tcx > ) -> Self {
181+ pub ( crate ) fn wildcard ( ty : Ty < ' tcx > ) -> Self {
182182 Self :: new ( Wildcard , Vec :: new ( ) , ty)
183183 }
184184
185185 /// Construct a pattern that matches everything that starts with this constructor.
186186 /// For example, if `ctor` is a `Constructor::Variant` for `Option::Some`, we get the pattern
187187 /// `Some(_)`.
188- pub ( super ) fn wild_from_ctor ( pcx : & PatCtxt < ' _ , ' _ , ' tcx > , ctor : Constructor < ' tcx > ) -> Self {
188+ pub ( crate ) fn wild_from_ctor ( pcx : & PatCtxt < ' _ , ' _ , ' tcx > , ctor : Constructor < ' tcx > ) -> Self {
189189 let field_tys =
190190 pcx. cx . ctor_wildcard_fields ( & ctor, pcx. ty ) . iter ( ) . map ( |deco_pat| deco_pat. ty ( ) ) ;
191191 let fields = field_tys. map ( |ty| Self :: wildcard ( ty) ) . collect ( ) ;
0 commit comments