@@ -48,6 +48,7 @@ use std::fs;
4848use std:: io:: { self , Write } ;
4949use std:: iter;
5050use std:: path:: { Path , PathBuf } ;
51+ use std:: rc:: Rc ;
5152use syntax:: { ast, diagnostics, visit} ;
5253use syntax:: attr;
5354use syntax:: ext:: base:: ExtCtxt ;
@@ -807,7 +808,7 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
807808 expanded_crate : krate,
808809 defs : resolver. definitions ,
809810 analysis : ty:: CrateAnalysis {
810- access_levels : AccessLevels :: default ( ) ,
811+ access_levels : Rc :: new ( AccessLevels :: default ( ) ) ,
811812 reachable : NodeSet ( ) ,
812813 name : crate_name. to_string ( ) ,
813814 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,
888889
889890 let mut local_providers = ty:: maps:: Providers :: default ( ) ;
890891 mir:: provide ( & mut local_providers) ;
892+ rustc_privacy:: provide ( & mut local_providers) ;
891893 typeck:: provide ( & mut local_providers) ;
892894 ty:: provide ( & mut local_providers) ;
893895
@@ -931,9 +933,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
931933 || consts:: check_crate ( tcx) ) ;
932934
933935 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) ) ;
937937
938938 time ( time_passes,
939939 "intrinsic checking" ,
@@ -1000,19 +1000,15 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
10001000 analysis. reachable =
10011001 time ( time_passes,
10021002 "reachability checking" ,
1003- || reachable:: find_reachable ( tcx, & analysis . access_levels ) ) ;
1003+ || reachable:: find_reachable ( tcx) ) ;
10041004
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) ) ;
10081006
10091007 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)
10111009 } ) ;
10121010
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) ) ;
10161012
10171013 // The above three passes generate errors w/o aborting
10181014 if sess. err_count ( ) > 0 {
0 commit comments