@@ -48,6 +48,7 @@ use std::fs;
48
48
use std:: io:: { self , Write } ;
49
49
use std:: iter;
50
50
use std:: path:: { Path , PathBuf } ;
51
+ use std:: rc:: Rc ;
51
52
use syntax:: { ast, diagnostics, visit} ;
52
53
use syntax:: attr;
53
54
use syntax:: ext:: base:: ExtCtxt ;
@@ -807,7 +808,7 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
807
808
expanded_crate : krate,
808
809
defs : resolver. definitions ,
809
810
analysis : ty:: CrateAnalysis {
810
- access_levels : AccessLevels :: default ( ) ,
811
+ access_levels : Rc :: new ( AccessLevels :: default ( ) ) ,
811
812
reachable : NodeSet ( ) ,
812
813
name : crate_name. to_string ( ) ,
813
814
glob_map : if resolver. make_glob_map { Some ( resolver. glob_map ) } else { None } ,
@@ -888,6 +889,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
888
889
889
890
let mut local_providers = ty:: maps:: Providers :: default ( ) ;
890
891
mir:: provide ( & mut local_providers) ;
892
+ rustc_privacy:: provide ( & mut local_providers) ;
891
893
typeck:: provide ( & mut local_providers) ;
892
894
ty:: provide ( & mut local_providers) ;
893
895
@@ -931,9 +933,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
931
933
|| consts:: check_crate ( tcx) ) ;
932
934
933
935
analysis. access_levels =
934
- time ( time_passes, "privacy checking" , || {
935
- rustc_privacy:: check_crate ( tcx)
936
- } ) ;
936
+ time ( time_passes, "privacy checking" , || rustc_privacy:: check_crate ( tcx) ) ;
937
937
938
938
time ( time_passes,
939
939
"intrinsic checking" ,
@@ -1000,19 +1000,15 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
1000
1000
analysis. reachable =
1001
1001
time ( time_passes,
1002
1002
"reachability checking" ,
1003
- || reachable:: find_reachable ( tcx, & analysis . access_levels ) ) ;
1003
+ || reachable:: find_reachable ( tcx) ) ;
1004
1004
1005
- time ( time_passes, "death checking" , || {
1006
- middle:: dead:: check_crate ( tcx, & analysis. access_levels ) ;
1007
- } ) ;
1005
+ time ( time_passes, "death checking" , || middle:: dead:: check_crate ( tcx) ) ;
1008
1006
1009
1007
time ( time_passes, "unused lib feature checking" , || {
1010
- stability:: check_unused_or_stable_features ( tcx, & analysis . access_levels )
1008
+ stability:: check_unused_or_stable_features ( tcx)
1011
1009
} ) ;
1012
1010
1013
- time ( time_passes,
1014
- "lint checking" ,
1015
- || lint:: check_crate ( tcx, & analysis. access_levels ) ) ;
1011
+ time ( time_passes, "lint checking" , || lint:: check_crate ( tcx) ) ;
1016
1012
1017
1013
// The above three passes generate errors w/o aborting
1018
1014
if sess. err_count ( ) > 0 {
0 commit comments