Skip to content

Commit 5a57f3d

Browse files
bors[bot]matklad
andauthored
Merge #4844
4844: Remove dead code r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 parents 32157d4 + 663ce0e commit 5a57f3d

File tree

4 files changed

+3
-29
lines changed

4 files changed

+3
-29
lines changed

crates/ra_ide_db/src/change.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_hash::FxHashMap;
1616

1717
use crate::{
1818
symbol_index::{SymbolIndex, SymbolsDatabase},
19-
DebugData, RootDatabase,
19+
RootDatabase,
2020
};
2121

2222
#[derive(Default)]
@@ -26,7 +26,6 @@ pub struct AnalysisChange {
2626
files_changed: Vec<(FileId, Arc<String>)>,
2727
libraries_added: Vec<LibraryData>,
2828
crate_graph: Option<CrateGraph>,
29-
debug_data: DebugData,
3029
}
3130

3231
impl fmt::Debug for AnalysisChange {
@@ -87,10 +86,6 @@ impl AnalysisChange {
8786
pub fn set_crate_graph(&mut self, graph: CrateGraph) {
8887
self.crate_graph = Some(graph);
8988
}
90-
91-
pub fn set_debug_root_path(&mut self, source_root_id: SourceRootId, path: String) {
92-
self.debug_data.root_paths.insert(source_root_id, path);
93-
}
9489
}
9590

9691
#[derive(Debug)]
@@ -218,8 +213,6 @@ impl RootDatabase {
218213
if let Some(crate_graph) = change.crate_graph {
219214
self.set_crate_graph_with_durability(Arc::new(crate_graph), Durability::HIGH)
220215
}
221-
222-
Arc::make_mut(&mut self.debug_data).merge(change.debug_data)
223216
}
224217

225218
fn apply_root_change(&mut self, root_id: SourceRootId, root_change: RootChange) {

crates/ra_ide_db/src/lib.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ use hir::db::{AstDatabase, DefDatabase};
1717
use ra_db::{
1818
salsa::{self, Database, Durability},
1919
Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase,
20-
SourceRootId, Upcast,
20+
Upcast,
2121
};
22-
use rustc_hash::{FxHashMap, FxHashSet};
22+
use rustc_hash::FxHashSet;
2323

2424
use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase};
2525

@@ -36,7 +36,6 @@ use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase};
3636
#[derive(Debug)]
3737
pub struct RootDatabase {
3838
runtime: salsa::Runtime<RootDatabase>,
39-
pub(crate) debug_data: Arc<DebugData>,
4039
pub last_gc: crate::wasm_shims::Instant,
4140
pub last_gc_check: crate::wasm_shims::Instant,
4241
}
@@ -98,7 +97,6 @@ impl RootDatabase {
9897
runtime: salsa::Runtime::default(),
9998
last_gc: crate::wasm_shims::Instant::now(),
10099
last_gc_check: crate::wasm_shims::Instant::now(),
101-
debug_data: Default::default(),
102100
};
103101
db.set_crate_graph_with_durability(Default::default(), Durability::HIGH);
104102
db.set_local_roots_with_durability(Default::default(), Durability::HIGH);
@@ -121,7 +119,6 @@ impl salsa::ParallelDatabase for RootDatabase {
121119
runtime: self.runtime.snapshot(self),
122120
last_gc: self.last_gc,
123121
last_gc_check: self.last_gc_check,
124-
debug_data: Arc::clone(&self.debug_data),
125122
})
126123
}
127124
}
@@ -135,14 +132,3 @@ fn line_index(db: &impl LineIndexDatabase, file_id: FileId) -> Arc<LineIndex> {
135132
let text = db.file_text(file_id);
136133
Arc::new(LineIndex::new(&*text))
137134
}
138-
139-
#[derive(Debug, Default, Clone)]
140-
pub(crate) struct DebugData {
141-
pub(crate) root_paths: FxHashMap<SourceRootId, String>,
142-
}
143-
144-
impl DebugData {
145-
pub(crate) fn merge(&mut self, other: DebugData) {
146-
self.root_paths.extend(other.root_paths.into_iter());
147-
}
148-
}

crates/rust-analyzer/src/cli/load_cargo.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,6 @@ pub(crate) fn load(
111111
vfs.root2path(root)
112112
);
113113
analysis_change.add_root(source_root_id, is_local);
114-
analysis_change.set_debug_root_path(
115-
source_root_id,
116-
source_roots[&source_root_id].path().display().to_string(),
117-
);
118114

119115
let vfs_root_path = vfs.root2path(root);
120116
if extern_dirs.contains(&vfs_root_path) {

crates/rust-analyzer/src/global_state.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ impl GlobalState {
126126
let vfs_root_path = vfs.root2path(r);
127127
let is_local = local_roots.iter().any(|it| vfs_root_path.starts_with(it));
128128
change.add_root(SourceRootId(r.0), is_local);
129-
change.set_debug_root_path(SourceRootId(r.0), vfs_root_path.display().to_string());
130129

131130
// FIXME: add path2root in vfs to simpily this logic
132131
if extern_dirs.contains(&vfs_root_path) {

0 commit comments

Comments
 (0)