Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trace_macros no longer shows up after hitting the recursion limit #42710

Closed
ExpHP opened this issue Jun 17, 2017 · 1 comment
Closed

trace_macros no longer shows up after hitting the recursion limit #42710

ExpHP opened this issue Jun 17, 2017 · 1 comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)

Comments

@ExpHP
Copy link
Contributor

ExpHP commented Jun 17, 2017

Got infinite loops in your macros? In the past, trace_macros had your back:

#![recursion_limit="8"]

#![feature(trace_macros)]
trace_macros!(true);

macro_rules! infinite { () => {loops!{}}; }
macro_rules! loops { () => {infinite!{}}; }

infinite!{}

Old behavior:

$ rustup override set nightly-2017-03-01
$ cargo run
   Compiling rec-macro v0.1.0 (file:///home/lampam/rec-macro)
infinite! {  }
loops! {  }
infinite! {  }
loops! {  }
infinite! {  }
loops! {  }
infinite! {  }
loops! {  }
error: recursion limit reached while expanding the macro `infinite`
 --> src/main.rs:7:29
  |
7 | macro_rules! loops { () => {infinite!{}}; }
  |                             ^^^^^^^^^^^
8 | 
9 | infinite!{}
  | ----------- in this macro invocation

error: Could not compile `rec-macro`.

New behavior: (notice: no trace_macros output)

$ rustup override set nightly
$ cargo run
   Compiling rec-macro v0.1.0 (file:///home/lampam/rec-macro)
error: recursion limit reached while expanding the macro `infinite`
 --> src/main.rs:7:29
  |
7 | macro_rules! loops { () => {infinite!{}}; }
  |                             ^^^^^^^^^^^
8 | 
9 | infinite!{}
  | ----------- in this macro invocation
  |
  = help: consider adding a `#![recursion_limit="16"]` attribute to your crate

error: Could not compile `rec-macro`.

To learn more, run the command again with --verbose.

Very few changes have been made to trace_macros in the last century; my money's on this one (a change prompted by discussion here)

@Mark-Simulacrum Mark-Simulacrum added the A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) label Jun 23, 2017
@Mark-Simulacrum
Copy link
Member

Closing in favor of #43493.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Projects
None yet
Development

No branches or pull requests

2 participants