Skip to content

Commit 1993f1e

Browse files
committed
Test that panic_fmt lint doesn't trigger for custom panic macro.
1 parent 190c3ad commit 1993f1e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/test/ui/panic-brace.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,11 @@ fn main() {
1515
panic!(S); // No warning (yet)
1616
panic!(concat!("{", "}")); //~ WARN panic message contains an unused formatting placeholder
1717
panic!(concat!("{", "{")); //~ WARN panic message contains braces
18+
19+
// Check that the lint only triggers for std::panic and core::panic,
20+
// not any panic macro:
21+
macro_rules! panic {
22+
($e:expr) => ();
23+
}
24+
panic!("{}"); // OK
1825
}

0 commit comments

Comments
 (0)