Skip to content

Commit 0e2ec8c

Browse files
committed
Ensure stack when parsing large if expressions
1 parent 304aca4 commit 0e2ec8c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_expand/expand.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use rustc_ast::visit::{self, AssocCtxt, Visitor};
1717
use rustc_ast_pretty::pprust;
1818
use rustc_attr::{self as attr, is_builtin_attr, HasAttrs};
1919
use rustc_data_structures::map_in_place::MapInPlace;
20+
use rustc_data_structures::stack::ensure_sufficient_stack;
2021
use rustc_errors::{Applicability, PResult};
2122
use rustc_feature::Features;
2223
use rustc_parse::parser::Parser;
@@ -1165,7 +1166,7 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
11651166
self.check_attributes(&expr.attrs);
11661167
self.collect_bang(mac, expr.span, AstFragmentKind::Expr).make_expr().into_inner()
11671168
} else {
1168-
noop_visit_expr(&mut expr, self);
1169+
ensure_sufficient_stack(|| noop_visit_expr(&mut expr, self));
11691170
expr
11701171
}
11711172
});

0 commit comments

Comments
 (0)