@@ -41,7 +41,7 @@ use syntax::parse::token::InternedString;
4141use syntax:: visit;
4242use log;
4343
44- pub struct LocalCrateReader < ' a > {
44+ struct LocalCrateReader < ' a > {
4545 sess : & ' a Session ,
4646 cstore : & ' a CStore ,
4747 creader : CrateReader < ' a > ,
@@ -841,12 +841,12 @@ impl<'a> CrateReader<'a> {
841841}
842842
843843impl < ' 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 > {
850850 LocalCrateReader {
851851 sess : sess,
852852 cstore : cstore,
@@ -859,7 +859,7 @@ impl<'a> LocalCrateReader<'a> {
859859 // Traverses an AST, reading all the information about use'd crates and
860860 // extern libraries necessary for later resolving, typechecking, linking,
861861 // etc.
862- pub fn read_crates ( & mut self , dep_graph : & DepGraph ) {
862+ fn read_crates ( & mut self , dep_graph : & DepGraph ) {
863863 let _task = dep_graph. in_task ( DepNode :: CrateReader ) ;
864864
865865 self . process_crate ( self . krate ) ;
@@ -981,6 +981,17 @@ impl<'a> LocalCrateReader<'a> {
981981 }
982982}
983983
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+
984995/// Imports the codemap from an external crate into the codemap of the crate
985996/// currently being compiled (the "local crate").
986997///
0 commit comments