aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src/expander
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mbe/src/expander')
-rw-r--r--crates/mbe/src/expander/transcriber.rs7
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
4use syntax::SmolStr; 4use syntax::SmolStr;
5use tt::Delimiter; 5use tt::{Delimiter, Subtree};
6 6
7use super::ExpandResult; 7use super::ExpandResult;
8use crate::{ 8use 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() {