diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-02 17:42:45 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-02 17:42:45 +0000 |
commit | a88d4f8c7216105e8bffed55fe85d9de796dc172 (patch) | |
tree | da8fe6fd5f771181ee1753907af22d9c0ce60586 /crates/mbe/src/mbe_expander/matcher.rs | |
parent | 510abef5da1427c542e7b37dcea805c7b022984c (diff) | |
parent | 3545289603dae852fb2b99181e9be5e3117b0a2e (diff) |
Merge #7133
7133: Proper handling $crate and local_inner_macros r=jonas-schievink a=edwin0cheng
This PR introduces `HygineFrames` to store the macro definition/call site hierarchy in hyginee and when resolving `local_inner_macros` and `$crate`, we use the token to look up the corresponding frame and return the correct value.
See also: https://rustc-dev-guide.rust-lang.org/macro-expansion.html#hygiene-and-hierarchies
fixe #6890 and #6788
r? @jonas-schievink
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/mbe/src/mbe_expander/matcher.rs')
-rw-r--r-- | crates/mbe/src/mbe_expander/matcher.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/mbe/src/mbe_expander/matcher.rs b/crates/mbe/src/mbe_expander/matcher.rs index ab5f87c48..385b46601 100644 --- a/crates/mbe/src/mbe_expander/matcher.rs +++ b/crates/mbe/src/mbe_expander/matcher.rs | |||
@@ -150,7 +150,7 @@ fn match_subtree( | |||
150 | res.add_err(err!("leftover tokens")); | 150 | res.add_err(err!("leftover tokens")); |
151 | } | 151 | } |
152 | } | 152 | } |
153 | Op::Var { name, kind } => { | 153 | Op::Var { name, kind, .. } => { |
154 | let kind = match kind { | 154 | let kind = match kind { |
155 | Some(k) => k, | 155 | Some(k) => k, |
156 | None => { | 156 | None => { |