store macro def inside macro id

This solves the problem of "macro expansion can't call into name
resolution, because name resolution calls back into macro expansion"

Because we store macro def as a part of call id, macro expansion just
knows the def!
This commit is contained in:
Aleksey Kladov
2019-03-26 13:09:39 +03:00
parent dc94f36125
commit 5270bca5f7
7 changed files with 73 additions and 119 deletions

View File

@@ -76,7 +76,7 @@ impl Module {
import: ImportId,
) -> TreeArc<ast::PathSegment> {
let (file_id, source) = self.definition_source(db);
let (_, source_map) = db.raw_items_with_source_map(file_id.original_file(db));
let (_, source_map) = db.raw_items_with_source_map(file_id);
source_map.get(&source, import)
}