mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 19:23:50 +00:00
Merge #9654
9654: minor: remove dead code r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
ec7b4cbf8f
@ -3,7 +3,6 @@
|
||||
|
||||
use std::{fmt, sync::Arc};
|
||||
|
||||
use rustc_hash::FxHashSet;
|
||||
use salsa::Durability;
|
||||
use vfs::FileId;
|
||||
|
||||
@ -52,26 +51,15 @@ impl Change {
|
||||
|
||||
pub fn apply(self, db: &mut dyn SourceDatabaseExt) {
|
||||
let _p = profile::span("RootDatabase::apply_change");
|
||||
// db.request_cancellation();
|
||||
// log::info!("apply_change {:?}", change);
|
||||
if let Some(roots) = self.roots {
|
||||
let mut local_roots = FxHashSet::default();
|
||||
let mut library_roots = FxHashSet::default();
|
||||
for (idx, root) in roots.into_iter().enumerate() {
|
||||
let root_id = SourceRootId(idx as u32);
|
||||
let durability = durability(&root);
|
||||
if root.is_library {
|
||||
library_roots.insert(root_id);
|
||||
} else {
|
||||
local_roots.insert(root_id);
|
||||
}
|
||||
for file_id in root.iter() {
|
||||
db.set_file_source_root_with_durability(file_id, root_id, durability);
|
||||
}
|
||||
db.set_source_root_with_durability(root_id, Arc::new(root), durability);
|
||||
}
|
||||
// db.set_local_roots_with_durability(Arc::new(local_roots), Durability::HIGH);
|
||||
// db.set_library_roots_with_durability(Arc::new(library_roots), Durability::HIGH);
|
||||
}
|
||||
|
||||
for (file_id, text) in self.files_changed {
|
||||
|
@ -411,7 +411,7 @@ impl ops::Index<CrateId> for CrateGraph {
|
||||
}
|
||||
|
||||
impl CrateId {
|
||||
pub fn shift(self, amount: u32) -> CrateId {
|
||||
fn shift(self, amount: u32) -> CrateId {
|
||||
CrateId(self.0 + amount)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user