File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed
src/tools/rust-analyzer/crates/hir-def/src Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ fn your_stack_belongs_to_me() {
5252 cov_mark:: check!( your_stack_belongs_to_me) ;
5353 lower (
5454 r#"
55+ #![recursion_limit = "32"]
5556macro_rules! n_nuple {
5657 ($e:tt) => ();
5758 ($($rest:tt)*) => {{
@@ -68,6 +69,7 @@ fn your_stack_belongs_to_me2() {
6869 cov_mark:: check!( overflow_but_not_me) ;
6970 lower (
7071 r#"
72+ #![recursion_limit = "32"]
7173macro_rules! foo {
7274 () => {{ foo!(); foo!(); }}
7375}
@@ -78,8 +80,6 @@ fn main() { foo!(); }
7880
7981#[ test]
8082fn recursion_limit ( ) {
81- cov_mark:: check!( your_stack_belongs_to_me) ;
82-
8383 lower (
8484 r#"
8585#![recursion_limit = "2"]
Original file line number Diff line number Diff line change @@ -1451,13 +1451,7 @@ impl DefCollector<'_> {
14511451 depth : usize ,
14521452 container : ItemContainerId ,
14531453 ) {
1454- let recursion_limit = self . def_map . recursion_limit ( ) as usize ;
1455- let recursion_limit = Limit :: new ( if cfg ! ( test) {
1456- // Without this, `body::tests::your_stack_belongs_to_me` stack-overflows in debug
1457- std:: cmp:: min ( 32 , recursion_limit)
1458- } else {
1459- recursion_limit
1460- } ) ;
1454+ let recursion_limit = Limit :: new ( self . def_map . recursion_limit ( ) as usize ) ;
14611455 if recursion_limit. check ( depth) . is_err ( ) {
14621456 cov_mark:: hit!( macro_expansion_overflow) ;
14631457 tracing:: warn!( "macro expansion is too deep" ) ;
You can’t perform that action at this time.
0 commit comments