Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/macro_expansion_tests/mod.rs')
-rw-r--r--crates/hir-def/src/macro_expansion_tests/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir-def/src/macro_expansion_tests/mod.rs b/crates/hir-def/src/macro_expansion_tests/mod.rs
index 1d6812ad56..c53a7321e8 100644
--- a/crates/hir-def/src/macro_expansion_tests/mod.rs
+++ b/crates/hir-def/src/macro_expansion_tests/mod.rs
@@ -62,7 +62,7 @@ fn check_errors(#[rust_analyzer::rust_fixture] ra_fixture: &str, expect: Expect)
.modules()
.flat_map(|module| module.1.scope.all_macro_calls())
.filter_map(|macro_call| {
- let errors = db.parse_macro_expansion_error(macro_call)?;
+ let errors = macro_call.parse_macro_expansion_error(&db)?;
let errors = errors.err.as_ref()?.render_to_string(&db);
let macro_loc = macro_call.loc(&db);
let ast_id = match macro_loc.kind {
@@ -75,7 +75,7 @@ fn check_errors(#[rust_analyzer::rust_fixture] ra_fixture: &str, expect: Expect)
ast_id.file_id.file_id().expect("macros inside macros are not supported");
let ast = editioned_file_id.parse(&db).syntax_node();
- let ast_id_map = db.ast_id_map(ast_id.file_id);
+ let ast_id_map = ast_id.file_id.ast_id_map(&db);
let node = ast_id_map.get_erased(ast_id.value).to_node(&ast);
Some((node.text_range(), errors))
})
@@ -120,12 +120,12 @@ pub fn identity_when_valid(_attr: TokenStream, item: TokenStream) -> TokenStream
let mut expansions = Vec::new();
for macro_call_node in source_file.syntax().descendants().filter_map(ast::MacroCall::cast) {
- let ast_id = db.ast_id_map(source.file_id).ast_id(&macro_call_node);
+ let ast_id = source.file_id.ast_id_map(&db).ast_id(&macro_call_node);
let ast_id = InFile::new(source.file_id, ast_id);
let ptr = InFile::new(source.file_id, AstPtr::new(&macro_call_node));
let macro_call_id = resolve_macro_call_id(&db, def_map, ast_id, ptr)
.unwrap_or_else(|| panic!("unable to find semantic macro call {macro_call_node}"));
- let expansion_result = db.parse_macro_expansion(macro_call_id);
+ let expansion_result = macro_call_id.parse_macro_expansion(&db);
expansions.push((macro_call_node.clone(), expansion_result));
}
@@ -476,7 +476,7 @@ m!(g);
.collect();
for macro_call_node in source_file.syntax().descendants().filter_map(ast::MacroCall::cast) {
- let ast_id = db.ast_id_map(source.file_id).ast_id(&macro_call_node);
+ let ast_id = source.file_id.ast_id_map(&db).ast_id(&macro_call_node);
let ast_id = InFile::new(source.file_id, ast_id);
let ptr = InFile::new(source.file_id, AstPtr::new(&macro_call_node));
let macro_call_id = resolve_macro_call_id(&db, def_map, ast_id, ptr)