Closed
Description
I tried this code:
[package]
# ...
edition = "2015"
let message = "message";
panic!(message);
I expected to see this happen: No warnings when compiling Rust 2015.
Instead, this happened:
|
25 | panic!(message);
| ^^^^^^^
|
= note: `#[warn(non_fmt_panic)]` on by default
= note: this is no longer accepted in Rust 2021
help: add a "{}" format string to Display the message
|
25 | panic!("{}", message);
| ^^^^^
help: or use std::panic::panic_any instead
|
25 | std::panic::panic_any(message);
| ^^^^^^^^^^^^^^^^^^^^^
warning: 1 warning emitted
Meta
rustc --version --verbose
:
rustc 1.52.1 (9bc8c42bb 2021-05-09)
binary: rustc
commit-hash: 9bc8c42bb2f19e745a63f3445f1ac248fb015e53
commit-date: 2021-05-09
host: x86_64-pc-windows-msvc
release: 1.52.1
LLVM version: 12.0.0