@@ -41,7 +41,7 @@ use syntax::parse::token::InternedString;
41
41
use syntax:: visit;
42
42
use log;
43
43
44
- pub struct LocalCrateReader < ' a > {
44
+ struct LocalCrateReader < ' a > {
45
45
sess : & ' a Session ,
46
46
cstore : & ' a CStore ,
47
47
creader : CrateReader < ' a > ,
@@ -841,12 +841,12 @@ impl<'a> CrateReader<'a> {
841
841
}
842
842
843
843
impl < ' a > LocalCrateReader < ' a > {
844
- pub fn new ( sess : & ' a Session ,
845
- cstore : & ' a CStore ,
846
- defs : & ' a hir_map:: Definitions ,
847
- krate : & ' a ast:: Crate ,
848
- local_crate_name : & str )
849
- -> LocalCrateReader < ' a > {
844
+ fn new ( sess : & ' a Session ,
845
+ cstore : & ' a CStore ,
846
+ defs : & ' a hir_map:: Definitions ,
847
+ krate : & ' a ast:: Crate ,
848
+ local_crate_name : & str )
849
+ -> LocalCrateReader < ' a > {
850
850
LocalCrateReader {
851
851
sess : sess,
852
852
cstore : cstore,
@@ -859,7 +859,7 @@ impl<'a> LocalCrateReader<'a> {
859
859
// Traverses an AST, reading all the information about use'd crates and
860
860
// extern libraries necessary for later resolving, typechecking, linking,
861
861
// etc.
862
- pub fn read_crates ( & mut self , dep_graph : & DepGraph ) {
862
+ fn read_crates ( & mut self , dep_graph : & DepGraph ) {
863
863
let _task = dep_graph. in_task ( DepNode :: CrateReader ) ;
864
864
865
865
self . process_crate ( self . krate ) ;
@@ -981,6 +981,17 @@ impl<'a> LocalCrateReader<'a> {
981
981
}
982
982
}
983
983
984
+ /// Traverses an AST, reading all the information about use'd crates and extern
985
+ /// libraries necessary for later resolving, typechecking, linking, etc.
986
+ pub fn read_local_crates ( sess : & Session ,
987
+ cstore : & CStore ,
988
+ defs : & hir_map:: Definitions ,
989
+ krate : & ast:: Crate ,
990
+ local_crate_name : & str ,
991
+ dep_graph : & DepGraph ) {
992
+ LocalCrateReader :: new ( sess, cstore, defs, krate, local_crate_name) . read_crates ( dep_graph)
993
+ }
994
+
984
995
/// Imports the codemap from an external crate into the codemap of the crate
985
996
/// currently being compiled (the "local crate").
986
997
///
0 commit comments