rust/src/test/ui/non-fmt-panic.stderr

249 lines
7.2 KiB
Plaintext

warning: panic message contains a brace
--> $DIR/non-fmt-panic.rs:11:29
|
LL | panic!("here's a brace: {");
| ^
|
= note: `#[warn(non_fmt_panic)]` on by default
= note: this message is not used as a format string, but will be in Rust 2021
help: add a "{}" format string to use the message literally
|
LL | panic!("{}", "here's a brace: {");
| ^^^^^
warning: panic message contains a brace
--> $DIR/non-fmt-panic.rs:12:31
|
LL | std::panic!("another one: }");
| ^
|
= note: this message is not used as a format string, but will be in Rust 2021
help: add a "{}" format string to use the message literally
|
LL | std::panic!("{}", "another one: }");
| ^^^^^
warning: panic message contains an unused formatting placeholder
--> $DIR/non-fmt-panic.rs:13:25
|
LL | core::panic!("Hello {}");
| ^^
|
= note: this message is not used as a format string when given without arguments, but will be in Rust 2021
help: add the missing argument
|
LL | core::panic!("Hello {}", ...);
| ^^^^^
help: or add a "{}" format string to use the message literally
|
LL | core::panic!("{}", "Hello {}");
| ^^^^^
warning: panic message contains unused formatting placeholders
--> $DIR/non-fmt-panic.rs:14:21
|
LL | assert!(false, "{:03x} {test} bla");
| ^^^^^^ ^^^^^^
|
= note: this message is not used as a format string when given without arguments, but will be in Rust 2021
help: add the missing arguments
|
LL | assert!(false, "{:03x} {test} bla", ...);
| ^^^^^
help: or add a "{}" format string to use the message literally
|
LL | assert!(false, "{}", "{:03x} {test} bla");
| ^^^^^
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);
| ^^^^^
warning: panic message contains braces
--> $DIR/non-fmt-panic.rs:18:27
|
LL | debug_assert!(false, "{{}} bla");
| ^^^^
|
= note: this message is not used as a format string, but will be in Rust 2021
help: add a "{}" format string to use the message literally
|
LL | debug_assert!(false, "{}", "{{}} bla");
| ^^^^^
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);
| ^^^^^^^^^^^^^^^^^^^^^
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);
| ^^^^^^^^^^^^^^^^^^^^^
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);
| ^^^^^^^^^^^^^^^^^^^^^
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");
| ^^^^^
warning: panic message contains an unused formatting placeholder
--> $DIR/non-fmt-panic.rs:23:12
|
LL | panic!(concat!("{", "}"));
| ^^^^^^^^^^^^^^^^^
|
= note: this message is not used as a format string when given without arguments, but will be in Rust 2021
help: add the missing argument
|
LL | panic!(concat!("{", "}"), ...);
| ^^^^^
help: or add a "{}" format string to use the message literally
|
LL | panic!("{}", concat!("{", "}"));
| ^^^^^
warning: panic message contains braces
--> $DIR/non-fmt-panic.rs:24:5
|
LL | panic!(concat!("{", "{"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this message is not used as a format string, but will be in Rust 2021
help: add a "{}" format string to use the message literally
|
LL | panic!("{}", concat!("{", "{"));
| ^^^^^
warning: panic message contains an unused formatting placeholder
--> $DIR/non-fmt-panic.rs:26:37
|
LL | fancy_panic::fancy_panic!("test {} 123");
| ^^
|
= 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
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!());
| ^^^^^^^^^^^^^^^^^^^^^
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);
| -- --
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:40:12
|
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
--> $DIR/non-fmt-panic.rs:41:12
|
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: 18 warnings emitted