rust/tests/ui/non-fmt-panic.stderr

492 lines
17 KiB
Plaintext
Raw Normal View History

warning: panic message contains a brace
2021-08-12 12:15:47 -05:00
--> $DIR/non-fmt-panic.rs:13:29
2020-10-18 15:52:36 -05:00
|
LL | panic!("here's a brace: {");
| ^
2020-10-18 15:52:36 -05:00
|
= note: this message is not used as a format string, but will be in Rust 2021
2022-09-18 10:55:36 -05:00
= note: `#[warn(non_fmt_panics)]` on by default
2020-10-18 15:52:36 -05:00
help: add a "{}" format string to use the message literally
|
LL | panic!("{}", "here's a brace: {");
| +++++
2020-10-18 15:52:36 -05:00
warning: panic message contains a brace
--> $DIR/non-fmt-panic.rs:14:35
|
LL | unreachable!("here's a brace: {");
| ^
|
= 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 | unreachable!("{}", "here's a brace: {");
| +++++
warning: panic message contains a brace
--> $DIR/non-fmt-panic.rs:15:31
2020-10-18 15:52:36 -05:00
|
LL | std::panic!("another one: }");
| ^
2020-10-18 15:52:36 -05:00
|
= note: this message is not used as a format string, but will be in Rust 2021
2020-10-18 15:52:36 -05:00
help: add a "{}" format string to use the message literally
|
LL | std::panic!("{}", "another one: }");
| +++++
2020-10-18 15:52:36 -05:00
warning: panic message contains an unused formatting placeholder
--> $DIR/non-fmt-panic.rs:16:25
2020-10-18 15:52:36 -05:00
|
LL | core::panic!("Hello {}");
| ^^
2020-10-18 15:52:36 -05:00
|
= 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
2020-10-18 15:52:36 -05:00
|
LL | core::panic!("{}", "Hello {}");
| +++++
2020-10-18 15:52:36 -05:00
warning: panic message contains unused formatting placeholders
--> $DIR/non-fmt-panic.rs:17:21
2020-10-18 15:52:36 -05:00
|
LL | assert!(false, "{:03x} {test} bla");
| ^^^^^^ ^^^^^^
2020-10-18 15:52:36 -05:00
|
= 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
2020-10-18 15:52:36 -05:00
|
LL | assert!(false, "{}", "{:03x} {test} bla");
| +++++
2020-10-18 15:52:36 -05:00
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:19:20
|
LL | assert!(false, S);
| ^
|
= note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to `Display` the message
|
LL | assert!(false, "{}", S);
| +++++
2021-08-16 10:26:08 -05:00
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:21:20
2021-08-16 10:26:08 -05:00
|
LL | assert!(false, 123);
| ^^^
|
= note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021
2021-08-16 10:26:08 -05:00
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to `Display` the message
2021-08-16 10:26:08 -05:00
|
LL | assert!(false, "{}", 123);
| +++++
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:23:20
2021-08-16 10:26:08 -05:00
|
LL | assert!(false, Some(123));
| ^^^^^^^^^
|
= note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021
2021-08-16 10:26:08 -05:00
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{:?}" format string to use the `Debug` implementation of `Option<i32>`
2021-08-16 10:26:08 -05:00
|
LL | assert!(false, "{:?}", Some(123));
| +++++++
warning: panic message contains braces
--> $DIR/non-fmt-panic.rs:25: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:26:12
|
LL | panic!(C);
| ^
|
= note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to `Display` the message
|
LL | panic!("{}", C);
| +++++
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:27:12
|
LL | panic!(S);
| ^
|
= note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to `Display` the message
|
LL | panic!("{}", S);
| +++++
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:28:18
|
LL | unreachable!(S);
| ^
|
= note: this usage of `unreachable!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to `Display` the message
|
LL | unreachable!("{}", S);
| +++++
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:29:18
|
LL | unreachable!(S);
| ^
|
= note: this usage of `unreachable!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to `Display` the message
|
LL | unreachable!("{}", S);
| +++++
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:30:17
|
LL | std::panic!(123);
| ^^^
|
= note: this usage of `std::panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
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:31:18
|
LL | core::panic!(&*"abc");
| ^^^^^^^
|
= note: this usage of `core::panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to `Display` the message
|
LL | core::panic!("{}", &*"abc");
| +++++
2021-08-16 10:26:08 -05:00
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:32:12
2021-08-16 10:26:08 -05:00
|
LL | panic!(Some(123));
| ^^^^^^^^^
|
= note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
2021-08-16 10:26:08 -05:00
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{:?}" format string to use the `Debug` implementation of `Option<i32>`
2021-08-16 10:26:08 -05:00
|
LL | panic!("{:?}", Some(123));
| +++++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(Some(123));
| ~~~~~~~~~~~~~~~~~~~~~
warning: panic message contains an unused formatting placeholder
--> $DIR/non-fmt-panic.rs:33: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:34:5
|
LL | panic!(concat!("{", "{"));
2021-10-14 13:28:28 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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:36: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:46:12
|
LL | panic!(a!());
| ^^^^
|
= note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
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 11:53:10 -06:00
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:47:18
|
LL | unreachable!(a!());
| ^^^^
|
= note: this usage of `unreachable!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to `Display` the message
|
LL | unreachable!("{}", a!());
| +++++
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:49:12
2021-02-14 11:53:10 -06:00
|
LL | panic!(format!("{}", 1));
| ^^^^^^^^^^^^^^^^
|
= note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
= note: the `panic!()` macro supports formatting, so there's no need for the `format!()` macro here
2021-02-14 11:53:10 -06:00
help: remove the `format!(..)` macro call
|
LL - panic!(format!("{}", 1));
LL + panic!("{}", 1);
2022-06-08 12:34:57 -05:00
|
2021-02-14 11:53:10 -06:00
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:50:18
|
LL | unreachable!(format!("{}", 1));
| ^^^^^^^^^^^^^^^^
|
= note: this usage of `unreachable!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
= note: the `unreachable!()` macro supports formatting, so there's no need for the `format!()` macro here
help: remove the `format!(..)` macro call
|
LL - unreachable!(format!("{}", 1));
LL + unreachable!("{}", 1);
2022-06-08 12:34:57 -05:00
|
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:51:20
|
LL | assert!(false, format!("{}", 1));
| ^^^^^^^^^^^^^^^^
|
= note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
= 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, format!("{}", 1));
LL + assert!(false, "{}", 1);
2022-06-08 12:34:57 -05:00
|
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:52:26
|
LL | debug_assert!(false, format!("{}", 1));
| ^^^^^^^^^^^^^^^^
|
= note: this usage of `debug_assert!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
= 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, format!("{}", 1));
LL + debug_assert!(false, "{}", 1);
2022-06-08 12:34:57 -05:00
|
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:54:12
|
LL | panic![123];
| ^^^
|
= note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
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:55:12
|
LL | panic!{123};
| ^^^
|
= note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
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:72:12
|
LL | panic!(v);
| ------ ^
| |
| help: use std::panic::panic_any instead: `std::panic::panic_any`
|
= note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:73:20
|
LL | assert!(false, v);
| ^
|
= note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:77:12
|
LL | panic!(v);
| ^
|
= note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{:?}" format string to use the `Debug` implementation of `T`
|
LL | panic!("{:?}", v);
| +++++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(v);
| ~~~~~~~~~~~~~~~~~~~~~
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:78:20
|
LL | assert!(false, v);
| ^
|
= note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{:?}" format string to use the `Debug` implementation of `T`
|
LL | assert!(false, "{:?}", v);
| +++++++
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:82:12
|
LL | panic!(v);
| ^
|
= note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to `Display` the message
|
LL | panic!("{}", v);
| +++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(v);
| ~~~~~~~~~~~~~~~~~~~~~
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:83:20
|
LL | assert!(false, v);
| ^
|
= note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to `Display` the message
|
LL | assert!(false, "{}", v);
| +++++
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:87:12
|
LL | panic!(v);
| ^
|
= note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to `Display` the message
|
LL | panic!("{}", v);
| +++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(v);
| ~~~~~~~~~~~~~~~~~~~~~
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:88:20
|
LL | assert!(false, v);
| ^
|
= note: this usage of `assert!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to `Display` the message
|
LL | assert!(false, "{}", v);
| +++++
warning: 35 warnings emitted
2020-10-18 15:52:36 -05:00