diff --git a/crates/mbe/src/mbe_expander/matcher.rs b/crates/mbe/src/mbe_expander/matcher.rs index 4860b242d0..93ee779086 100644 --- a/crates/mbe/src/mbe_expander/matcher.rs +++ b/crates/mbe/src/mbe_expander/matcher.rs @@ -357,9 +357,9 @@ impl<'a> TtIter<'a> { } } - pub(crate) fn eat_char(&mut self) -> Option { + pub(crate) fn eat_char(&mut self, c: char) -> Option { let mut fork = self.clone(); - match fork.expect_char('-') { + match fork.expect_char(c) { Ok(_) => { let tt = self.next().cloned(); *self = fork; @@ -460,7 +460,7 @@ fn match_meta_var(kind: &str, input: &mut TtIter) -> ExpandResult { - let neg = input.eat_char(); + let neg = input.eat_char('-'); input .expect_literal() .map(|literal| {