aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe
diff options
context:
space:
mode:
authoruHOOCCOOHu <[email protected]>2019-09-26 18:59:38 +0100
committeruHOOCCOOHu <[email protected]>2019-09-26 19:05:06 +0100
commit2ecb126f5caeb248e333f8559eb1b7dfd34cc744 (patch)
tree02ca4f902520e3d2ec98fe8ce71be8a319bcdc66 /crates/ra_mbe
parent8cd23a4fb8c6a1012ba3e40dd3329a5abaed06b7 (diff)
Support `$crate` in item and expr place.
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r--crates/ra_mbe/src/mbe_expander/transcriber.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_mbe/src/mbe_expander/transcriber.rs b/crates/ra_mbe/src/mbe_expander/transcriber.rs
index c22680b93..ed094d5bb 100644
--- a/crates/ra_mbe/src/mbe_expander/transcriber.rs
+++ b/crates/ra_mbe/src/mbe_expander/transcriber.rs
@@ -86,7 +86,7 @@ fn expand_subtree(ctx: &mut ExpandCtx, template: &tt::Subtree) -> Result<tt::Sub
86 86
87fn expand_var(ctx: &mut ExpandCtx, v: &SmolStr) -> Result<Fragment, ExpandError> { 87fn expand_var(ctx: &mut ExpandCtx, v: &SmolStr) -> Result<Fragment, ExpandError> {
88 let res = if v == "crate" { 88 let res = if v == "crate" {
89 // FIXME: Properly handle $crate token 89 // We simply produce identifier `$crate` here. And it will be resolved when lowering ast to Path.
90 let tt = 90 let tt =
91 tt::Leaf::from(tt::Ident { text: "$crate".into(), id: tt::TokenId::unspecified() }) 91 tt::Leaf::from(tt::Ident { text: "$crate".into(), id: tt::TokenId::unspecified() })
92 .into(); 92 .into();