diff options
author | Aleksey Kladov <[email protected]> | 2020-11-02 12:13:32 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-11-02 13:07:08 +0000 |
commit | b6101184537b1165cfdd5fc473e04ad4c5b7bffa (patch) | |
tree | bcc2efd8a2696840a4724ad88758e973ecb77157 /crates/hir_ty/src/test_db.rs | |
parent | e7f90866bcf4b04a11e958eda0ac53f7ff0a607b (diff) |
Deny unreachable-pub
It's very useful when `pub` is equivalent to "this is crate's public
API", let's enforce this!
Ideally, we should enforce it for local `cargo test`, and only during
CI, but that needs https://github.com/rust-lang/cargo/issues/5034.
Diffstat (limited to 'crates/hir_ty/src/test_db.rs')
-rw-r--r-- | crates/hir_ty/src/test_db.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir_ty/src/test_db.rs b/crates/hir_ty/src/test_db.rs index 15b8435e9..22254b765 100644 --- a/crates/hir_ty/src/test_db.rs +++ b/crates/hir_ty/src/test_db.rs | |||
@@ -21,7 +21,7 @@ use test_utils::extract_annotations; | |||
21 | crate::db::HirDatabaseStorage | 21 | crate::db::HirDatabaseStorage |
22 | )] | 22 | )] |
23 | #[derive(Default)] | 23 | #[derive(Default)] |
24 | pub struct TestDB { | 24 | pub(crate) struct TestDB { |
25 | storage: salsa::Storage<TestDB>, | 25 | storage: salsa::Storage<TestDB>, |
26 | events: Mutex<Option<Vec<salsa::Event>>>, | 26 | events: Mutex<Option<Vec<salsa::Event>>>, |
27 | } | 27 | } |
@@ -113,13 +113,13 @@ impl TestDB { | |||
113 | } | 113 | } |
114 | 114 | ||
115 | impl TestDB { | 115 | impl TestDB { |
116 | pub fn log(&self, f: impl FnOnce()) -> Vec<salsa::Event> { | 116 | pub(crate) fn log(&self, f: impl FnOnce()) -> Vec<salsa::Event> { |
117 | *self.events.lock().unwrap() = Some(Vec::new()); | 117 | *self.events.lock().unwrap() = Some(Vec::new()); |
118 | f(); | 118 | f(); |
119 | self.events.lock().unwrap().take().unwrap() | 119 | self.events.lock().unwrap().take().unwrap() |
120 | } | 120 | } |
121 | 121 | ||
122 | pub fn log_executed(&self, f: impl FnOnce()) -> Vec<String> { | 122 | pub(crate) fn log_executed(&self, f: impl FnOnce()) -> Vec<String> { |
123 | let events = self.log(f); | 123 | let events = self.log(f); |
124 | events | 124 | events |
125 | .into_iter() | 125 | .into_iter() |