diff options
Diffstat (limited to 'crates/ra_mbe/src/mbe_expander.rs')
-rw-r--r-- | crates/ra_mbe/src/mbe_expander.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/ra_mbe/src/mbe_expander.rs index 3a4dbb5f5..7fff8deff 100644 --- a/crates/ra_mbe/src/mbe_expander.rs +++ b/crates/ra_mbe/src/mbe_expander.rs | |||
@@ -281,7 +281,11 @@ fn match_lhs(pattern: &crate::Subtree, input: &mut TtCursor) -> Result<Bindings, | |||
281 | return Err(ExpandError::UnexpectedToken); | 281 | return Err(ExpandError::UnexpectedToken); |
282 | } | 282 | } |
283 | } | 283 | } |
284 | _ => return Err(ExpandError::UnexpectedToken), | 284 | crate::Leaf::Literal(literal) => { |
285 | if input.eat_literal().map(|i| &i.text) != Some(&literal.text) { | ||
286 | return Err(ExpandError::UnexpectedToken); | ||
287 | } | ||
288 | } | ||
285 | }, | 289 | }, |
286 | crate::TokenTree::Repeat(crate::Repeat { subtree, kind, separator }) => { | 290 | crate::TokenTree::Repeat(crate::Repeat { subtree, kind, separator }) => { |
287 | // Dirty hack to make macro-expansion terminate. | 291 | // Dirty hack to make macro-expansion terminate. |