diff options
Diffstat (limited to 'crates/mbe/src/subtree_source.rs')
-rw-r--r-- | crates/mbe/src/subtree_source.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/mbe/src/subtree_source.rs b/crates/mbe/src/subtree_source.rs index d10d4b70e..36d6f1038 100644 --- a/crates/mbe/src/subtree_source.rs +++ b/crates/mbe/src/subtree_source.rs | |||
@@ -53,10 +53,12 @@ impl<'a> SubtreeTokenSource<'a> { | |||
53 | fn is_lifetime(c: Cursor) -> Option<(Cursor, SmolStr)> { | 53 | fn is_lifetime(c: Cursor) -> Option<(Cursor, SmolStr)> { |
54 | let tkn = c.token_tree(); | 54 | let tkn = c.token_tree(); |
55 | 55 | ||
56 | if let Some(tt::TokenTree::Leaf(tt::Leaf::Punct(punct))) = tkn { | 56 | if let Some(tt::buffer::TokenTreeRef::Leaf(tt::Leaf::Punct(punct), _)) = tkn { |
57 | if punct.char == '\'' { | 57 | if punct.char == '\'' { |
58 | let next = c.bump(); | 58 | let next = c.bump(); |
59 | if let Some(tt::TokenTree::Leaf(tt::Leaf::Ident(ident))) = next.token_tree() { | 59 | if let Some(tt::buffer::TokenTreeRef::Leaf(tt::Leaf::Ident(ident), _)) = |
60 | next.token_tree() | ||
61 | { | ||
60 | let res_cursor = next.bump(); | 62 | let res_cursor = next.bump(); |
61 | let text = SmolStr::new("'".to_string() + &ident.to_string()); | 63 | let text = SmolStr::new("'".to_string() + &ident.to_string()); |
62 | 64 | ||
@@ -94,11 +96,11 @@ impl<'a> SubtreeTokenSource<'a> { | |||
94 | } | 96 | } |
95 | 97 | ||
96 | match cursor.token_tree() { | 98 | match cursor.token_tree() { |
97 | Some(tt::TokenTree::Leaf(leaf)) => { | 99 | Some(tt::buffer::TokenTreeRef::Leaf(leaf, _)) => { |
98 | cached.push(Some(convert_leaf(&leaf))); | 100 | cached.push(Some(convert_leaf(&leaf))); |
99 | self.cached_cursor.set(cursor.bump()); | 101 | self.cached_cursor.set(cursor.bump()); |
100 | } | 102 | } |
101 | Some(tt::TokenTree::Subtree(subtree)) => { | 103 | Some(tt::buffer::TokenTreeRef::Subtree(subtree, _)) => { |
102 | self.cached_cursor.set(cursor.subtree().unwrap()); | 104 | self.cached_cursor.set(cursor.subtree().unwrap()); |
103 | cached.push(Some(convert_delim(subtree.delimiter_kind(), false))); | 105 | cached.push(Some(convert_delim(subtree.delimiter_kind(), false))); |
104 | } | 106 | } |