diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-09 16:07:33 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-09 16:07:33 +0000 |
commit | 99118eeccdf6564876bbe6ec0672b04ffcbe3442 (patch) | |
tree | 08f0fd7d99ad22a3d1db782482b66548e99ba8b2 /crates/hir_expand/src/builtin_macro.rs | |
parent | 42be522c80cf0cc2d49b60f3c1d66afdc51fcbbb (diff) | |
parent | 6e24321e4579d25686982002ed18f321db23cb9f (diff) |
Merge #6784
6784: Introduce anchored_path r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/hir_expand/src/builtin_macro.rs')
-rw-r--r-- | crates/hir_expand/src/builtin_macro.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs index 79b970850..f60666a54 100644 --- a/crates/hir_expand/src/builtin_macro.rs +++ b/crates/hir_expand/src/builtin_macro.rs | |||
@@ -4,7 +4,7 @@ use crate::{ | |||
4 | MacroDefId, MacroDefKind, TextSize, | 4 | MacroDefId, MacroDefKind, TextSize, |
5 | }; | 5 | }; |
6 | 6 | ||
7 | use base_db::FileId; | 7 | use base_db::{AnchoredPath, FileId}; |
8 | use either::Either; | 8 | use either::Either; |
9 | use mbe::{parse_to_token_tree, ExpandResult}; | 9 | use mbe::{parse_to_token_tree, ExpandResult}; |
10 | use parser::FragmentKind; | 10 | use parser::FragmentKind; |
@@ -324,7 +324,8 @@ fn relative_file( | |||
324 | allow_recursion: bool, | 324 | allow_recursion: bool, |
325 | ) -> Option<FileId> { | 325 | ) -> Option<FileId> { |
326 | let call_site = call_id.as_file().original_file(db); | 326 | let call_site = call_id.as_file().original_file(db); |
327 | let res = db.resolve_path(call_site, path)?; | 327 | let path = AnchoredPath { anchor: call_site, path }; |
328 | let res = db.resolve_path(path)?; | ||
328 | // Prevent include itself | 329 | // Prevent include itself |
329 | if res == call_site && !allow_recursion { | 330 | if res == call_site && !allow_recursion { |
330 | None | 331 | None |