diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-05 07:47:22 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-05 07:47:22 +0100 |
commit | 9c302980e386734472f9bae50a0db59247cba623 (patch) | |
tree | eb4c2f6f30944ebdc8bee7aa6c548986f7595228 /crates/ra_mbe/src/mbe_expander.rs | |
parent | 9239a13159d8c9217991ec08cc878c35da019a87 (diff) | |
parent | a48e33f1391596f5a746279a6e456024254fe908 (diff) |
Merge #1242
1242: Fix missing empty vars in $repeat while macro expansion r=matklad a=edwin0cheng
This PR fixes a bug we forget to collect an empty vars in $repeat patterns.
Related issues: #1240
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_mbe/src/mbe_expander.rs')
-rw-r--r-- | crates/ra_mbe/src/mbe_expander.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/ra_mbe/src/mbe_expander.rs index 4b007647c..3a4dbb5f5 100644 --- a/crates/ra_mbe/src/mbe_expander.rs +++ b/crates/ra_mbe/src/mbe_expander.rs | |||
@@ -177,6 +177,9 @@ fn collect_vars(subtree: &crate::Subtree) -> Vec<SmolStr> { | |||
177 | crate::TokenTree::Subtree(subtree) => { | 177 | crate::TokenTree::Subtree(subtree) => { |
178 | res.extend(collect_vars(subtree)); | 178 | res.extend(collect_vars(subtree)); |
179 | } | 179 | } |
180 | crate::TokenTree::Repeat(crate::Repeat { subtree, .. }) => { | ||
181 | res.extend(collect_vars(subtree)); | ||
182 | } | ||
180 | _ => {} | 183 | _ => {} |
181 | } | 184 | } |
182 | } | 185 | } |