diff --git a/crates/ra_mbe/src/tt_cursor.rs b/crates/ra_mbe/src/tt_cursor.rs index 818c412a08fc..741b5ea1cc7b 100644 --- a/crates/ra_mbe/src/tt_cursor.rs +++ b/crates/ra_mbe/src/tt_cursor.rs @@ -134,6 +134,13 @@ impl<'a> TtCursor<'a> { } pub(crate) fn eat_lifetime(&mut self) -> Option { + // check if it start from "`" + if let Some(ident) = self.at_ident() { + if ident.text.chars().next()? != '\'' { + return None; + } + } + self.eat_ident().cloned().map(|ident| tt::Leaf::from(ident).into()) }