diff options
author | Jonas Schievink <[email protected]> | 2020-12-15 14:37:37 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-12-15 14:37:37 +0000 |
commit | c1cb5953820f26d4d0a614650bc8c50cbc5a3ce6 (patch) | |
tree | 01ba67d97ce6f261154df59b268fe924af9add2a /crates/hir_def/src/path | |
parent | 39aae835fd70d06092c1be1add6eef3984439529 (diff) |
Move to upstream `macro_rules!` model
Diffstat (limited to 'crates/hir_def/src/path')
-rw-r--r-- | crates/hir_def/src/path/lower.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/hir_def/src/path/lower.rs b/crates/hir_def/src/path/lower.rs index 60fa7646b..609925012 100644 --- a/crates/hir_def/src/path/lower.rs +++ b/crates/hir_def/src/path/lower.rs | |||
@@ -122,11 +122,9 @@ pub(super) fn lower_path(mut path: ast::Path, hygiene: &Hygiene) -> Option<Path> | |||
122 | // https://github.com/rust-lang/rust/blob/614f273e9388ddd7804d5cbc80b8865068a3744e/src/librustc_resolve/macros.rs#L456 | 122 | // https://github.com/rust-lang/rust/blob/614f273e9388ddd7804d5cbc80b8865068a3744e/src/librustc_resolve/macros.rs#L456 |
123 | // We follow what it did anyway :) | 123 | // We follow what it did anyway :) |
124 | if segments.len() == 1 && kind == PathKind::Plain { | 124 | if segments.len() == 1 && kind == PathKind::Plain { |
125 | if let Some(macro_call) = path.syntax().parent().and_then(ast::MacroCall::cast) { | 125 | if let Some(_macro_call) = path.syntax().parent().and_then(ast::MacroCall::cast) { |
126 | if macro_call.is_bang() { | 126 | if let Some(crate_id) = hygiene.local_inner_macros() { |
127 | if let Some(crate_id) = hygiene.local_inner_macros() { | 127 | kind = PathKind::DollarCrate(crate_id); |
128 | kind = PathKind::DollarCrate(crate_id); | ||
129 | } | ||
130 | } | 128 | } |
131 | } | 129 | } |
132 | } | 130 | } |