2020-10-18 15:52:36 -05:00
|
|
|
// build-pass (FIXME(62277): should be check-pass)
|
|
|
|
|
2020-10-20 15:59:53 -05:00
|
|
|
const C: &str = "abc {}";
|
|
|
|
static S: &str = "{bla}";
|
|
|
|
|
2020-10-18 15:52:36 -05:00
|
|
|
#[allow(unreachable_code)]
|
|
|
|
fn main() {
|
2020-10-19 14:14:05 -05:00
|
|
|
panic!("here's a brace: {"); //~ WARN panic message contains a brace
|
|
|
|
std::panic!("another one: }"); //~ WARN panic message contains a brace
|
|
|
|
core::panic!("Hello {}"); //~ WARN panic message contains an unused formatting placeholder
|
2020-10-20 15:59:53 -05:00
|
|
|
assert!(false, "{:03x} {test} bla");
|
|
|
|
//~^ WARN panic message contains unused formatting placeholders
|
|
|
|
debug_assert!(false, "{{}} bla"); //~ WARN panic message contains braces
|
|
|
|
panic!(C); // No warning (yet)
|
|
|
|
panic!(S); // No warning (yet)
|
|
|
|
panic!(concat!("{", "}")); //~ WARN panic message contains an unused formatting placeholder
|
|
|
|
panic!(concat!("{", "{")); //~ WARN panic message contains braces
|
2020-10-18 15:52:36 -05:00
|
|
|
}
|