@@ -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 > ) -> Pat < ' tcx > {
77
+ fn lower_pattern ( & mut self , pat : & ' tcx hir:: Pat < ' tcx > ) -> 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
//
@@ -615,15 +615,15 @@ impl<'tcx> UserAnnotatedTyHelpers<'tcx> for PatCtxt<'_, 'tcx> {
615
615
}
616
616
}
617
617
618
- pub ( crate ) trait PatternFoldable < ' tcx > : Sized {
618
+ trait PatternFoldable < ' tcx > : Sized {
619
619
fn fold_with < F : PatternFolder < ' tcx > > ( & self , folder : & mut F ) -> Self {
620
620
self . super_fold_with ( folder)
621
621
}
622
622
623
623
fn super_fold_with < F : PatternFolder < ' tcx > > ( & self , folder : & mut F ) -> Self ;
624
624
}
625
625
626
- pub ( crate ) trait PatternFolder < ' tcx > : Sized {
626
+ trait PatternFolder < ' tcx > : Sized {
627
627
fn fold_pattern ( & mut self , pattern : & Pat < ' tcx > ) -> Pat < ' tcx > {
628
628
pattern. super_fold_with ( self )
629
629
}
0 commit comments