We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f80e108 + b3b9104 commit 7808982Copy full SHA for 7808982
crates/mbe/src/expander/transcriber.rs
@@ -2,7 +2,7 @@
2
//! `$ident => foo`, interpolates variables in the template, to get `fn foo() {}`
3
4
use syntax::SmolStr;
5
-use tt::Delimiter;
+use tt::{Delimiter, Subtree};
6
7
use super::ExpandResult;
8
use crate::{
@@ -175,7 +175,10 @@ fn expand_repeat(
175
counter += 1;
176
if counter == limit {
177
log::warn!("expand_tt in repeat pattern exceed limit => {:#?}\n{:#?}", template, ctx);
178
- break;
+ return ExpandResult {
179
+ value: Fragment::Tokens(Subtree::default().into()),
180
+ err: Some(ExpandError::Other("Expand exceed limit".to_string())),
181
+ };
182
}
183
184
if e.is_some() {
0 commit comments