@@ -29,22 +29,22 @@ use rustc_span::{Span, Symbol};
2929use std:: cmp:: Ordering ;
3030
3131#[ derive( Clone , Debug ) ]
32- pub ( crate ) enum PatternError {
32+ enum PatternError {
3333 AssocConstInPattern ( Span ) ,
3434 ConstParamInPattern ( Span ) ,
3535 StaticInPattern ( Span ) ,
3636 NonConstPath ( Span ) ,
3737}
3838
39- pub ( crate ) struct PatCtxt < ' a , ' tcx > {
40- pub ( crate ) tcx : TyCtxt < ' tcx > ,
41- pub ( crate ) param_env : ty:: ParamEnv < ' tcx > ,
42- pub ( crate ) typeck_results : & ' a ty:: TypeckResults < ' tcx > ,
43- pub ( crate ) errors : Vec < PatternError > ,
39+ struct PatCtxt < ' a , ' tcx > {
40+ tcx : TyCtxt < ' tcx > ,
41+ param_env : ty:: ParamEnv < ' tcx > ,
42+ typeck_results : & ' a ty:: TypeckResults < ' tcx > ,
43+ errors : Vec < PatternError > ,
4444 include_lint_checks : bool ,
4545}
4646
47- pub ( crate ) fn pat_from_hir < ' a , ' tcx > (
47+ pub ( super ) fn pat_from_hir < ' a , ' tcx > (
4848 tcx : TyCtxt < ' tcx > ,
4949 param_env : ty:: ParamEnv < ' tcx > ,
5050 typeck_results : & ' a ty:: TypeckResults < ' tcx > ,
@@ -61,20 +61,20 @@ pub(crate) fn pat_from_hir<'a, 'tcx>(
6161}
6262
6363impl < ' a , ' tcx > PatCtxt < ' a , ' tcx > {
64- pub ( crate ) fn new (
64+ fn new (
6565 tcx : TyCtxt < ' tcx > ,
6666 param_env : ty:: ParamEnv < ' tcx > ,
6767 typeck_results : & ' a ty:: TypeckResults < ' tcx > ,
6868 ) -> Self {
6969 PatCtxt { tcx, param_env, typeck_results, errors : vec ! [ ] , include_lint_checks : false }
7070 }
7171
72- pub ( crate ) fn include_lint_checks ( & mut self ) -> & mut Self {
72+ fn include_lint_checks ( & mut self ) -> & mut Self {
7373 self . include_lint_checks = true ;
7474 self
7575 }
7676
77- pub ( crate ) fn lower_pattern ( & mut self , pat : & ' tcx hir:: Pat < ' tcx > ) -> Pat < ' tcx > {
77+ fn lower_pattern ( & mut self , pat : & ' tcx hir:: Pat < ' tcx > ) -> Pat < ' tcx > {
7878 // When implicit dereferences have been inserted in this pattern, the unadjusted lowered
7979 // pattern has the type that results *after* dereferencing. For example, in this code:
8080 //
@@ -615,15 +615,15 @@ impl<'tcx> UserAnnotatedTyHelpers<'tcx> for PatCtxt<'_, 'tcx> {
615615 }
616616}
617617
618- pub ( crate ) trait PatternFoldable < ' tcx > : Sized {
618+ trait PatternFoldable < ' tcx > : Sized {
619619 fn fold_with < F : PatternFolder < ' tcx > > ( & self , folder : & mut F ) -> Self {
620620 self . super_fold_with ( folder)
621621 }
622622
623623 fn super_fold_with < F : PatternFolder < ' tcx > > ( & self , folder : & mut F ) -> Self ;
624624}
625625
626- pub ( crate ) trait PatternFolder < ' tcx > : Sized {
626+ trait PatternFolder < ' tcx > : Sized {
627627 fn fold_pattern ( & mut self , pattern : & Pat < ' tcx > ) -> Pat < ' tcx > {
628628 pattern. super_fold_with ( self )
629629 }
0 commit comments