diff options
author | Edwin Cheng <[email protected]> | 2019-04-19 14:43:41 +0100 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-04-19 14:43:41 +0100 |
commit | 763569017a61f5294750cdd0d4aee02d0bf76166 (patch) | |
tree | 5741762dae9326edb069bbd1c21aa0526f8aeed8 | |
parent | 87ff908135a28115593f8cf895d176aef331347c (diff) |
Fix bug for ident to lifetime
-rw-r--r-- | crates/ra_mbe/src/tt_cursor.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_mbe/src/tt_cursor.rs b/crates/ra_mbe/src/tt_cursor.rs index 818c412a0..741b5ea1c 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> { | |||
134 | } | 134 | } |
135 | 135 | ||
136 | pub(crate) fn eat_lifetime(&mut self) -> Option<tt::TokenTree> { | 136 | pub(crate) fn eat_lifetime(&mut self) -> Option<tt::TokenTree> { |
137 | // check if it start from "`" | ||
138 | if let Some(ident) = self.at_ident() { | ||
139 | if ident.text.chars().next()? != '\'' { | ||
140 | return None; | ||
141 | } | ||
142 | } | ||
143 | |||
137 | self.eat_ident().cloned().map(|ident| tt::Leaf::from(ident).into()) | 144 | self.eat_ident().cloned().map(|ident| tt::Leaf::from(ident).into()) |
138 | } | 145 | } |
139 | 146 | ||