diff options
Diffstat (limited to 'crates/mbe/src/expander')
-rw-r--r-- | crates/mbe/src/expander/transcriber.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/mbe/src/expander/transcriber.rs b/crates/mbe/src/expander/transcriber.rs index c679e5e5d..dd7fa97d7 100644 --- a/crates/mbe/src/expander/transcriber.rs +++ b/crates/mbe/src/expander/transcriber.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | //! `$ident => foo`, interpolates variables in the template, to get `fn foo() {}` | 2 | //! `$ident => foo`, interpolates variables in the template, to get `fn foo() {}` |
3 | 3 | ||
4 | use syntax::SmolStr; | 4 | use syntax::SmolStr; |
5 | use tt::Delimiter; | 5 | use tt::{Delimiter, Subtree}; |
6 | 6 | ||
7 | use super::ExpandResult; | 7 | use super::ExpandResult; |
8 | use crate::{ | 8 | use crate::{ |
@@ -175,7 +175,10 @@ fn expand_repeat( | |||
175 | counter += 1; | 175 | counter += 1; |
176 | if counter == limit { | 176 | if counter == limit { |
177 | log::warn!("expand_tt in repeat pattern exceed limit => {:#?}\n{:#?}", template, ctx); | 177 | log::warn!("expand_tt in repeat pattern exceed limit => {:#?}\n{:#?}", template, ctx); |
178 | break; | 178 | return ExpandResult { |
179 | value: Fragment::Tokens(Subtree::default().into()), | ||
180 | err: Some(ExpandError::Other("Expand exceed limit".to_string())), | ||
181 | }; | ||
179 | } | 182 | } |
180 | 183 | ||
181 | if e.is_some() { | 184 | if e.is_some() { |