diff options
Diffstat (limited to 'crates/mbe/src/tt_iter.rs')
-rw-r--r-- | crates/mbe/src/tt_iter.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/mbe/src/tt_iter.rs b/crates/mbe/src/tt_iter.rs index 5a4eca7bf..65da83476 100644 --- a/crates/mbe/src/tt_iter.rs +++ b/crates/mbe/src/tt_iter.rs | |||
@@ -121,10 +121,11 @@ impl<'a> TtIter<'a> { | |||
121 | 121 | ||
122 | parser::parse_fragment(&mut src, &mut sink, fragment_kind); | 122 | parser::parse_fragment(&mut src, &mut sink, fragment_kind); |
123 | 123 | ||
124 | let mut err = None; | 124 | let mut err = if !sink.cursor.is_root() || sink.error { |
125 | if !sink.cursor.is_root() || sink.error { | 125 | Some(err!("expected {:?}", fragment_kind)) |
126 | err = Some(err!("expected {:?}", fragment_kind)); | 126 | } else { |
127 | } | 127 | None |
128 | }; | ||
128 | 129 | ||
129 | let mut curr = buffer.begin(); | 130 | let mut curr = buffer.begin(); |
130 | let mut res = vec![]; | 131 | let mut res = vec![]; |