From 6b993a97602da5ddee4033d4d76a68471f8d1ee1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 9 Apr 2019 22:51:22 +0300 Subject: migrate to salsas interning --- crates/ra_batch/src/lib.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'crates/ra_batch') diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_batch/src/lib.rs index 5bb47afb2..0cafe617d 100644 --- a/crates/ra_batch/src/lib.rs +++ b/crates/ra_batch/src/lib.rs @@ -9,7 +9,7 @@ use rustc_hash::FxHashMap; use ra_db::{ CrateGraph, FileId, SourceRoot, SourceRootId, SourceDatabase, salsa, }; -use ra_hir::{db, HirInterner}; +use ra_hir::db; use ra_project_model::ProjectWorkspace; use ra_vfs::{Vfs, VfsChange}; use vfs_filter::IncludeRustFiles; @@ -20,7 +20,6 @@ type Result = std::result::Result; #[derive(Debug)] pub struct BatchDatabase { runtime: salsa::Runtime, - interner: Arc, } impl salsa::Database for BatchDatabase { @@ -29,12 +28,6 @@ impl salsa::Database for BatchDatabase { } } -impl AsRef for BatchDatabase { - fn as_ref(&self) -> &HirInterner { - &self.interner - } -} - fn vfs_file_to_id(f: ra_vfs::VfsFile) -> FileId { FileId(f.0.into()) } @@ -44,8 +37,7 @@ fn vfs_root_to_id(r: ra_vfs::VfsRoot) -> SourceRootId { impl BatchDatabase { pub fn load(crate_graph: CrateGraph, vfs: &mut Vfs) -> BatchDatabase { - let mut db = - BatchDatabase { runtime: salsa::Runtime::default(), interner: Default::default() }; + let mut db = BatchDatabase { runtime: salsa::Runtime::default() }; db.set_crate_graph(Arc::new(crate_graph)); // wait until Vfs has loaded all roots -- cgit v1.2.3