2020-10-19 19:14:05 +00:00
|
|
|
warning: panic message contains a brace
|
2021-02-01 21:30:09 +00:00
|
|
|
--> $DIR/non-fmt-panic.rs:11:29
|
2020-10-18 20:52:36 +00:00
|
|
|
|
|
|
|
|
LL | panic!("here's a brace: {");
|
2020-10-20 20:59:53 +00:00
|
|
|
| ^
|
2020-10-18 20:52:36 +00:00
|
|
|
|
|
2021-02-01 21:30:09 +00:00
|
|
|
= note: `#[warn(non_fmt_panic)]` on by default
|
|
|
|
= note: this message is not used as a format string, but will be in Rust 2021
|
2020-10-18 20:52:36 +00:00
|
|
|
help: add a "{}" format string to use the message literally
|
|
|
|
|
|
|
|
|
LL | panic!("{}", "here's a brace: {");
|
|
|
|
| ^^^^^
|
|
|
|
|
2020-10-19 19:14:05 +00:00
|
|
|
warning: panic message contains a brace
|
2021-02-01 21:30:09 +00:00
|
|
|
--> $DIR/non-fmt-panic.rs:12:31
|
2020-10-18 20:52:36 +00:00
|
|
|
|
|
|
|
|
LL | std::panic!("another one: }");
|
2020-10-20 20:59:53 +00:00
|
|
|
| ^
|
2020-10-18 20:52:36 +00:00
|
|
|
|
|
2021-02-01 21:30:09 +00:00
|
|
|
= note: this message is not used as a format string, but will be in Rust 2021
|
2020-10-18 20:52:36 +00:00
|
|
|
help: add a "{}" format string to use the message literally
|
|
|
|
|
|
|
|
|
LL | std::panic!("{}", "another one: }");
|
|
|
|
| ^^^^^
|
|
|
|
|
2020-10-19 19:14:05 +00:00
|
|
|
warning: panic message contains an unused formatting placeholder
|
2021-02-01 21:30:09 +00:00
|
|
|
--> $DIR/non-fmt-panic.rs:13:25
|
2020-10-18 20:52:36 +00:00
|
|
|
|
|
2020-10-18 21:36:00 +00:00
|
|
|
LL | core::panic!("Hello {}");
|
2020-10-20 20:25:42 +00:00
|
|
|
| ^^
|
2020-10-18 20:52:36 +00:00
|
|
|
|
|
2021-02-01 21:30:09 +00:00
|
|
|
= note: this message is not used as a format string when given without arguments, but will be in Rust 2021
|
2020-10-29 18:44:06 +00:00
|
|
|
help: add the missing argument
|
2020-10-18 21:36:00 +00:00
|
|
|
|
|
2020-10-20 20:25:42 +00:00
|
|
|
LL | core::panic!("Hello {}", ...);
|
|
|
|
| ^^^^^
|
2020-10-18 21:36:00 +00:00
|
|
|
help: or add a "{}" format string to use the message literally
|
2020-10-18 20:52:36 +00:00
|
|
|
|
|
2020-10-18 21:36:00 +00:00
|
|
|
LL | core::panic!("{}", "Hello {}");
|
2020-10-18 20:52:36 +00:00
|
|
|
| ^^^^^
|
|
|
|
|
2020-10-20 20:25:42 +00:00
|
|
|
warning: panic message contains unused formatting placeholders
|
2021-02-01 21:30:09 +00:00
|
|
|
--> $DIR/non-fmt-panic.rs:14:21
|
2020-10-18 20:52:36 +00:00
|
|
|
|
|
2020-10-20 20:25:42 +00:00
|
|
|
LL | assert!(false, "{:03x} {test} bla");
|
|
|
|
| ^^^^^^ ^^^^^^
|
2020-10-18 20:52:36 +00:00
|
|
|
|
|
2021-02-01 21:30:09 +00:00
|
|
|
= note: this message is not used as a format string when given without arguments, but will be in Rust 2021
|
2020-10-29 18:44:06 +00:00
|
|
|
help: add the missing arguments
|
2020-10-18 21:36:00 +00:00
|
|
|
|
|
2020-10-20 20:25:42 +00:00
|
|
|
LL | assert!(false, "{:03x} {test} bla", ...);
|
|
|
|
| ^^^^^
|
2020-10-18 21:36:00 +00:00
|
|
|
help: or add a "{}" format string to use the message literally
|
2020-10-18 20:52:36 +00:00
|
|
|
|
|
2020-10-20 20:25:42 +00:00
|
|
|
LL | assert!(false, "{}", "{:03x} {test} bla");
|
2020-10-18 20:52:36 +00:00
|
|
|
| ^^^^^
|
|
|
|
|
2021-02-01 21:30:09 +00:00
|
|
|
warning: panic message is not a string literal
|
|
|
|
--> $DIR/non-fmt-panic.rs:16:20
|
|
|
|
|
|
|
|
|
LL | assert!(false, S);
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= note: this is no longer accepted in Rust 2021
|
|
|
|
help: add a "{}" format string to Display the message
|
|
|
|
|
|
|
|
|
LL | assert!(false, "{}", S);
|
|
|
|
| ^^^^^
|
|
|
|
|
2020-10-20 20:59:53 +00:00
|
|
|
warning: panic message contains braces
|
2021-02-01 21:30:09 +00:00
|
|
|
--> $DIR/non-fmt-panic.rs:18:27
|
2020-10-18 22:45:07 +00:00
|
|
|
|
|
|
|
|
LL | debug_assert!(false, "{{}} bla");
|
2020-10-20 20:59:53 +00:00
|
|
|
| ^^^^
|
2020-10-18 22:45:07 +00:00
|
|
|
|
|
2021-02-01 21:30:09 +00:00
|
|
|
= note: this message is not used as a format string, but will be in Rust 2021
|
2020-10-18 22:45:07 +00:00
|
|
|
help: add a "{}" format string to use the message literally
|
|
|
|
|
|
|
|
|
LL | debug_assert!(false, "{}", "{{}} bla");
|
|
|
|
| ^^^^^
|
|
|
|
|
2021-02-01 21:30:09 +00:00
|
|
|
warning: panic message is not a string literal
|
|
|
|
--> $DIR/non-fmt-panic.rs:19:12
|
|
|
|
|
|
|
|
|
LL | panic!(C);
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= note: this is no longer accepted in Rust 2021
|
|
|
|
help: add a "{}" format string to Display the message
|
|
|
|
|
|
|
|
|
LL | panic!("{}", C);
|
|
|
|
| ^^^^^
|
|
|
|
help: or use std::panic::panic_any instead
|
|
|
|
|
|
|
|
|
LL | std::panic::panic_any(C);
|
2021-02-14 18:43:07 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2021-02-01 21:30:09 +00:00
|
|
|
|
|
|
|
warning: panic message is not a string literal
|
|
|
|
--> $DIR/non-fmt-panic.rs:20:12
|
|
|
|
|
|
|
|
|
LL | panic!(S);
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= note: this is no longer accepted in Rust 2021
|
|
|
|
help: add a "{}" format string to Display the message
|
|
|
|
|
|
|
|
|
LL | panic!("{}", S);
|
|
|
|
| ^^^^^
|
|
|
|
help: or use std::panic::panic_any instead
|
|
|
|
|
|
|
|
|
LL | std::panic::panic_any(S);
|
2021-02-14 18:43:07 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2021-02-01 21:30:09 +00:00
|
|
|
|
|
|
|
warning: panic message is not a string literal
|
|
|
|
--> $DIR/non-fmt-panic.rs:21:17
|
|
|
|
|
|
|
|
|
LL | std::panic!(123);
|
|
|
|
| ^^^
|
|
|
|
|
|
|
|
|
= note: this is no longer accepted in Rust 2021
|
|
|
|
help: add a "{}" format string to Display the message
|
|
|
|
|
|
|
|
|
LL | std::panic!("{}", 123);
|
|
|
|
| ^^^^^
|
|
|
|
help: or use std::panic::panic_any instead
|
|
|
|
|
|
|
|
|
LL | std::panic::panic_any(123);
|
2021-02-14 18:43:07 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2021-02-01 21:30:09 +00:00
|
|
|
|
|
|
|
warning: panic message is not a string literal
|
|
|
|
--> $DIR/non-fmt-panic.rs:22:18
|
|
|
|
|
|
|
|
|
LL | core::panic!(&*"abc");
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
|
= note: this is no longer accepted in Rust 2021
|
|
|
|
help: add a "{}" format string to Display the message
|
|
|
|
|
|
|
|
|
LL | core::panic!("{}", &*"abc");
|
|
|
|
| ^^^^^
|
|
|
|
|
2020-10-20 20:59:53 +00:00
|
|
|
warning: panic message contains an unused formatting placeholder
|
2021-02-01 21:30:09 +00:00
|
|
|
--> $DIR/non-fmt-panic.rs:23:12
|
2020-10-20 20:59:53 +00:00
|
|
|
|
|
|
|
|
LL | panic!(concat!("{", "}"));
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2021-02-01 21:30:09 +00:00
|
|
|
= note: this message is not used as a format string when given without arguments, but will be in Rust 2021
|
2020-10-29 18:44:06 +00:00
|
|
|
help: add the missing argument
|
2020-10-20 20:59:53 +00:00
|
|
|
|
|
|
|
|
LL | panic!(concat!("{", "}"), ...);
|
|
|
|
| ^^^^^
|
|
|
|
help: or add a "{}" format string to use the message literally
|
|
|
|
|
|
|
|
|
LL | panic!("{}", concat!("{", "}"));
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
warning: panic message contains braces
|
2021-02-01 21:30:09 +00:00
|
|
|
--> $DIR/non-fmt-panic.rs:24:5
|
2020-10-20 20:59:53 +00:00
|
|
|
|
|
|
|
|
LL | panic!(concat!("{", "{"));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2021-02-01 21:30:09 +00:00
|
|
|
= note: this message is not used as a format string, but will be in Rust 2021
|
2020-10-20 20:59:53 +00:00
|
|
|
help: add a "{}" format string to use the message literally
|
|
|
|
|
|
|
|
|
LL | panic!("{}", concat!("{", "{"));
|
|
|
|
| ^^^^^
|
|
|
|
|
2020-10-29 21:21:40 +00:00
|
|
|
warning: panic message contains an unused formatting placeholder
|
2021-02-01 21:30:09 +00:00
|
|
|
--> $DIR/non-fmt-panic.rs:26:37
|
2020-10-29 21:21:40 +00:00
|
|
|
|
|
|
|
|
LL | fancy_panic::fancy_panic!("test {} 123");
|
|
|
|
| ^^
|
|
|
|
|
|
2021-02-01 21:30:09 +00:00
|
|
|
= note: this message is not used as a format string when given without arguments, but will be in Rust 2021
|
|
|
|
|
|
|
|
warning: panic message is not a string literal
|
|
|
|
--> $DIR/non-fmt-panic.rs:29:31
|
|
|
|
|
|
|
|
|
LL | fancy_panic::fancy_panic!(S);
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= note: this is no longer accepted in Rust 2021
|
2020-10-29 21:21:40 +00:00
|
|
|
|
2021-02-14 17:17:34 +00:00
|
|
|
warning: panic message is not a string literal
|
|
|
|
--> $DIR/non-fmt-panic.rs:36:12
|
|
|
|
|
|
|
|
|
LL | panic!(a!());
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
|
= note: this is no longer accepted in Rust 2021
|
|
|
|
help: add a "{}" format string to Display the message
|
|
|
|
|
|
|
|
|
LL | panic!("{}", a!());
|
|
|
|
| ^^^^^
|
|
|
|
help: or use std::panic::panic_any instead
|
|
|
|
|
|
|
|
|
LL | std::panic::panic_any(a!());
|
2021-02-14 18:43:07 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2021-02-14 17:17:34 +00:00
|
|
|
|
2021-02-14 17:53:10 +00:00
|
|
|
warning: panic message is not a string literal
|
|
|
|
--> $DIR/non-fmt-panic.rs:38:12
|
|
|
|
|
|
|
|
|
LL | panic!(format!("{}", 1));
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: this is no longer accepted in Rust 2021
|
|
|
|
= note: the panic!() macro supports formatting, so there's no need for the format!() macro here
|
|
|
|
help: remove the `format!(..)` macro call
|
|
|
|
|
|
|
|
|
LL | panic!("{}", 1);
|
|
|
|
| -- --
|
|
|
|
|
2021-02-14 18:44:57 +00:00
|
|
|
warning: panic message is not a string literal
|
2021-05-07 17:09:15 +00:00
|
|
|
--> $DIR/non-fmt-panic.rs:39:20
|
|
|
|
|
|
|
|
|
LL | assert!(false, format!("{}", 1));
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: this is no longer accepted in Rust 2021
|
|
|
|
= note: the assert!() macro supports formatting, so there's no need for the format!() macro here
|
|
|
|
help: remove the `format!(..)` macro call
|
|
|
|
|
|
|
|
|
LL | assert!(false, "{}", 1);
|
|
|
|
| -- --
|
|
|
|
|
|
|
|
warning: panic message is not a string literal
|
|
|
|
--> $DIR/non-fmt-panic.rs:40:26
|
|
|
|
|
|
|
|
|
LL | debug_assert!(false, format!("{}", 1));
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: this is no longer accepted in Rust 2021
|
|
|
|
= note: the debug_assert!() macro supports formatting, so there's no need for the format!() macro here
|
|
|
|
help: remove the `format!(..)` macro call
|
|
|
|
|
|
|
|
|
LL | debug_assert!(false, "{}", 1);
|
|
|
|
| -- --
|
|
|
|
|
|
|
|
warning: panic message is not a string literal
|
|
|
|
--> $DIR/non-fmt-panic.rs:42:12
|
2021-02-14 18:44:57 +00:00
|
|
|
|
|
|
|
|
LL | panic![123];
|
|
|
|
| ^^^
|
|
|
|
|
|
|
|
|
= note: this is no longer accepted in Rust 2021
|
|
|
|
help: add a "{}" format string to Display the message
|
|
|
|
|
|
|
|
|
LL | panic!["{}", 123];
|
|
|
|
| ^^^^^
|
|
|
|
help: or use std::panic::panic_any instead
|
|
|
|
|
|
|
|
|
LL | std::panic::panic_any(123);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ ^
|
|
|
|
|
|
|
|
warning: panic message is not a string literal
|
2021-05-07 17:09:15 +00:00
|
|
|
--> $DIR/non-fmt-panic.rs:43:12
|
2021-02-14 18:44:57 +00:00
|
|
|
|
|
|
|
|
LL | panic!{123};
|
|
|
|
| ^^^
|
|
|
|
|
|
|
|
|
= note: this is no longer accepted in Rust 2021
|
|
|
|
help: add a "{}" format string to Display the message
|
|
|
|
|
|
|
|
|
LL | panic!{"{}", 123};
|
|
|
|
| ^^^^^
|
|
|
|
help: or use std::panic::panic_any instead
|
|
|
|
|
|
|
|
|
LL | std::panic::panic_any(123);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ ^
|
|
|
|
|
2021-05-07 17:09:15 +00:00
|
|
|
warning: 20 warnings emitted
|
2020-10-18 20:52:36 +00:00
|
|
|
|