Test that panic_fmt lint doesn't trigger for custom panic macro.
This commit is contained in:
parent
190c3ad64e
commit
1993f1efe7
1 changed files with 7 additions and 0 deletions
|
|
@ -15,4 +15,11 @@ fn main() {
|
|||
panic!(S); // No warning (yet)
|
||||
panic!(concat!("{", "}")); //~ WARN panic message contains an unused formatting placeholder
|
||||
panic!(concat!("{", "{")); //~ WARN panic message contains braces
|
||||
|
||||
// Check that the lint only triggers for std::panic and core::panic,
|
||||
// not any panic macro:
|
||||
macro_rules! panic {
|
||||
($e:expr) => ();
|
||||
}
|
||||
panic!("{}"); // OK
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue