mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
fix tests
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
SourceFileItems, SourceItemId,
|
||||
query_definitions,
|
||||
FnScopes,
|
||||
macros::{MacroCallLoc, MacroCallId, MacroInput, MacroDef, MacroExpansion},
|
||||
macros::{MacroCallLoc, MacroCallId, MacroExpansion},
|
||||
module::{ModuleId, ModuleTree, ModuleSource,
|
||||
nameres::{ItemMap, InputModuleItems}},
|
||||
ty::{InferenceResult, Ty},
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
use relative_path::RelativePathBuf;
|
||||
use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset};
|
||||
|
||||
use crate::{db, DefId, DefLoc};
|
||||
use crate::{db, DefId, DefLoc, MacroCallId, MacroCallLoc};
|
||||
|
||||
pub const WORKSPACE: SourceRootId = SourceRootId(0);
|
||||
|
||||
@@ -95,6 +95,7 @@ fn add_file_with_position(
|
||||
#[derive(Debug, Default)]
|
||||
struct IdMaps {
|
||||
defs: LocationIntener<DefLoc, DefId>,
|
||||
macros: LocationIntener<MacroCallLoc, MacroCallId>,
|
||||
}
|
||||
|
||||
impl salsa::Database for MockDatabase {
|
||||
@@ -144,6 +145,11 @@ fn as_ref(&self) -> &LocationIntener<DefLoc, DefId> {
|
||||
&self.id_maps.defs
|
||||
}
|
||||
}
|
||||
impl AsRef<LocationIntener<MacroCallLoc, MacroCallId>> for MockDatabase {
|
||||
fn as_ref(&self) -> &LocationIntener<MacroCallLoc, MacroCallId> {
|
||||
&self.id_maps.macros
|
||||
}
|
||||
}
|
||||
|
||||
impl MockDatabase {
|
||||
pub(crate) fn log(&self, f: impl FnOnce()) -> Vec<salsa::Event<MockDatabase>> {
|
||||
@@ -183,6 +189,7 @@ impl ra_db::SyntaxDatabase {
|
||||
fn file_lines() for ra_db::FileLinesQuery;
|
||||
}
|
||||
impl db::HirDatabase {
|
||||
fn expand_macro_invocation() for db::ExpandMacroCallQuery;
|
||||
fn module_tree() for db::ModuleTreeQuery;
|
||||
fn fn_scopes() for db::FnScopesQuery;
|
||||
fn file_items() for db::SourceFileItemsQuery;
|
||||
|
||||
Reference in New Issue
Block a user