@@ -25,7 +25,7 @@ use crate::{db::DefDatabase, ModuleDefId};
2525 crate :: db:: DefDatabaseStorage
2626) ]
2727#[ derive( Default ) ]
28- pub struct TestDB {
28+ pub ( crate ) struct TestDB {
2929 storage : salsa:: Storage < TestDB > ,
3030 events : Mutex < Option < Vec < salsa:: Event > > > ,
3131}
@@ -72,7 +72,7 @@ impl FileLoader for TestDB {
7272}
7373
7474impl TestDB {
75- pub fn module_for_file ( & self , file_id : FileId ) -> crate :: ModuleId {
75+ pub ( crate ) fn module_for_file ( & self , file_id : FileId ) -> crate :: ModuleId {
7676 for & krate in self . relevant_crates ( file_id) . iter ( ) {
7777 let crate_def_map = self . crate_def_map ( krate) ;
7878 for ( local_id, data) in crate_def_map. modules . iter ( ) {
@@ -84,13 +84,13 @@ impl TestDB {
8484 panic ! ( "Can't find module for file" )
8585 }
8686
87- pub fn log ( & self , f : impl FnOnce ( ) ) -> Vec < salsa:: Event > {
87+ pub ( crate ) fn log ( & self , f : impl FnOnce ( ) ) -> Vec < salsa:: Event > {
8888 * self . events . lock ( ) . unwrap ( ) = Some ( Vec :: new ( ) ) ;
8989 f ( ) ;
9090 self . events . lock ( ) . unwrap ( ) . take ( ) . unwrap ( )
9191 }
9292
93- pub fn log_executed ( & self , f : impl FnOnce ( ) ) -> Vec < String > {
93+ pub ( crate ) fn log_executed ( & self , f : impl FnOnce ( ) ) -> Vec < String > {
9494 let events = self . log ( f) ;
9595 events
9696 . into_iter ( )
@@ -105,7 +105,7 @@ impl TestDB {
105105 . collect ( )
106106 }
107107
108- pub fn extract_annotations ( & self ) -> FxHashMap < FileId , Vec < ( TextRange , String ) > > {
108+ pub ( crate ) fn extract_annotations ( & self ) -> FxHashMap < FileId , Vec < ( TextRange , String ) > > {
109109 let mut files = Vec :: new ( ) ;
110110 let crate_graph = self . crate_graph ( ) ;
111111 for krate in crate_graph. iter ( ) {
@@ -129,7 +129,7 @@ impl TestDB {
129129 . collect ( )
130130 }
131131
132- pub fn diagnostics < F : FnMut ( & dyn Diagnostic ) > ( & self , mut cb : F ) {
132+ pub ( crate ) fn diagnostics < F : FnMut ( & dyn Diagnostic ) > ( & self , mut cb : F ) {
133133 let crate_graph = self . crate_graph ( ) ;
134134 for krate in crate_graph. iter ( ) {
135135 let crate_def_map = self . crate_def_map ( krate) ;
@@ -148,7 +148,7 @@ impl TestDB {
148148 }
149149 }
150150
151- pub fn check_diagnostics ( & self ) {
151+ pub ( crate ) fn check_diagnostics ( & self ) {
152152 let db: & TestDB = self ;
153153 let annotations = db. extract_annotations ( ) ;
154154 assert ! ( !annotations. is_empty( ) ) ;
0 commit comments