@@ -29,22 +29,22 @@ use rustc_span::{Span, Symbol};
29
29
use std:: cmp:: Ordering ;
30
30
31
31
#[ derive( Clone , Debug ) ]
32
- pub ( crate ) enum PatternError {
32
+ enum PatternError {
33
33
AssocConstInPattern ( Span ) ,
34
34
ConstParamInPattern ( Span ) ,
35
35
StaticInPattern ( Span ) ,
36
36
NonConstPath ( Span ) ,
37
37
}
38
38
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 > ,
44
44
include_lint_checks : bool ,
45
45
}
46
46
47
- pub ( crate ) fn pat_from_hir < ' a , ' tcx > (
47
+ pub ( super ) fn pat_from_hir < ' a , ' tcx > (
48
48
tcx : TyCtxt < ' tcx > ,
49
49
param_env : ty:: ParamEnv < ' tcx > ,
50
50
typeck_results : & ' a ty:: TypeckResults < ' tcx > ,
@@ -61,20 +61,20 @@ pub(crate) fn pat_from_hir<'a, 'tcx>(
61
61
}
62
62
63
63
impl < ' a , ' tcx > PatCtxt < ' a , ' tcx > {
64
- pub ( crate ) fn new (
64
+ fn new (
65
65
tcx : TyCtxt < ' tcx > ,
66
66
param_env : ty:: ParamEnv < ' tcx > ,
67
67
typeck_results : & ' a ty:: TypeckResults < ' tcx > ,
68
68
) -> Self {
69
69
PatCtxt { tcx, param_env, typeck_results, errors : vec ! [ ] , include_lint_checks : false }
70
70
}
71
71
72
- pub ( crate ) fn include_lint_checks ( & mut self ) -> & mut Self {
72
+ fn include_lint_checks ( & mut self ) -> & mut Self {
73
73
self . include_lint_checks = true ;
74
74
self
75
75
}
76
76
77
- pub ( crate ) fn lower_pattern ( & mut self , pat : & ' tcx hir:: Pat < ' tcx > ) -> Box < Pat < ' tcx > > {
77
+ fn lower_pattern ( & mut self , pat : & ' tcx hir:: Pat < ' tcx > ) -> Box < Pat < ' tcx > > {
78
78
// When implicit dereferences have been inserted in this pattern, the unadjusted lowered
79
79
// pattern has the type that results *after* dereferencing. For example, in this code:
80
80
//
@@ -622,15 +622,15 @@ impl<'tcx> UserAnnotatedTyHelpers<'tcx> for PatCtxt<'_, 'tcx> {
622
622
}
623
623
}
624
624
625
- pub ( crate ) trait PatternFoldable < ' tcx > : Sized {
625
+ trait PatternFoldable < ' tcx > : Sized {
626
626
fn fold_with < F : PatternFolder < ' tcx > > ( & self , folder : & mut F ) -> Self {
627
627
self . super_fold_with ( folder)
628
628
}
629
629
630
630
fn super_fold_with < F : PatternFolder < ' tcx > > ( & self , folder : & mut F ) -> Self ;
631
631
}
632
632
633
- pub ( crate ) trait PatternFolder < ' tcx > : Sized {
633
+ trait PatternFolder < ' tcx > : Sized {
634
634
fn fold_pattern ( & mut self , pattern : & Pat < ' tcx > ) -> Pat < ' tcx > {
635
635
pattern. super_fold_with ( self )
636
636
}
0 commit comments