mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00

The test cases for issue 41731 are about infinite macro recursion that incorporates `print!` and `println!`. However, they also included trailing semicolons despite expanding to expressions; that isn't what these particular test cases are designed to test. Eliminate the trailing semicolons, to simplify future work on removing this special case. Every *other* macro that expands to a semicolon in an expression is a test case for that specifically.
16 lines
341 B
Rust
16 lines
341 B
Rust
//@ compile-flags: -Z trace-macros
|
|
|
|
#![recursion_limit = "5"]
|
|
|
|
fn main() {
|
|
macro_rules! stack {
|
|
($overflow:expr) => {
|
|
println!(stack!($overflow))
|
|
//~^ ERROR recursion limit reached while expanding
|
|
//~| ERROR format argument must be a string literal
|
|
};
|
|
}
|
|
|
|
stack!("overflow");
|
|
}
|