rust/src/test/ui/panic-brace.stderr

72 lines
2.3 KiB
Plaintext
Raw Normal View History

2020-10-18 20:52:36 +00:00
warning: Panic message contains a brace
--> $DIR/panic-brace.rs:5:5
|
LL | panic!("here's a brace: {");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(panic_fmt)]` on by default
= note: This message is not used as a format string, but will be in a future Rust version
help: add a "{}" format string to use the message literally
|
LL | panic!("{}", "here's a brace: {");
| ^^^^^
warning: Panic message contains a brace
--> $DIR/panic-brace.rs:6:5
|
LL | std::panic!("another one: }");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: This message is not used as a format string, but will be in a future Rust version
help: add a "{}" format string to use the message literally
|
LL | std::panic!("{}", "another one: }");
| ^^^^^
warning: Panic message contains an unused formatting placeholder
--> $DIR/panic-brace.rs:7:18
2020-10-18 20:52:36 +00:00
|
LL | core::panic!("Hello {}");
| ^^^^^^^^^^
2020-10-18 20:52:36 +00:00
|
= note: This message is not used as a format string when given without arguments, but will be in a future Rust version
help: add the missing argument(s)
|
LL | core::panic!("Hello {}", argument);
| ^^^^^^^^^^
help: or add a "{}" format string to use the message literally
2020-10-18 20:52:36 +00:00
|
LL | core::panic!("{}", "Hello {}");
2020-10-18 20:52:36 +00:00
| ^^^^^
warning: Panic message contains an unused formatting placeholder
--> $DIR/panic-brace.rs:8:20
2020-10-18 20:52:36 +00:00
|
LL | assert!(false, "{:03x} bla");
| ^^^^^^^^^^^^
2020-10-18 20:52:36 +00:00
|
= note: This message is not used as a format string when given without arguments, but will be in a future Rust version
help: add the missing argument(s)
|
LL | assert!(false, "{:03x} bla", argument);
| ^^^^^^^^^^
help: or add a "{}" format string to use the message literally
2020-10-18 20:52:36 +00:00
|
LL | assert!(false, "{}", "{:03x} bla");
2020-10-18 20:52:36 +00:00
| ^^^^^
warning: Panic message contains a brace
--> $DIR/panic-brace.rs:9:5
|
LL | debug_assert!(false, "{{}} bla");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: This message is not used as a format string, but will be in a future Rust version
help: add a "{}" format string to use the message literally
|
LL | debug_assert!(false, "{}", "{{}} bla");
| ^^^^^
warning: 5 warnings emitted
2020-10-18 20:52:36 +00:00