2022-10-13 11:40:13 +00:00
|
|
|
// revisions: edition2018 edition2021
|
|
|
|
//[edition2018] edition:2018
|
|
|
|
//[edition2021] edition:2021
|
2022-10-08 08:49:00 +00:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
#![warn(clippy::uninlined_format_args)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let var = 1;
|
|
|
|
|
|
|
|
println!("val='{var}'");
|
|
|
|
|
|
|
|
if var > 0 {
|
|
|
|
panic!("p1 {var}");
|
|
|
|
}
|
|
|
|
if var > 0 {
|
|
|
|
panic!("p2 {var}");
|
|
|
|
}
|
|
|
|
if var > 0 {
|
|
|
|
panic!("p3 {var}");
|
|
|
|
}
|
2022-10-13 11:40:13 +00:00
|
|
|
|
|
|
|
#[allow(non_fmt_panics)]
|
|
|
|
{
|
|
|
|
if var > 0 {
|
|
|
|
panic!("p4 {var}");
|
|
|
|
}
|
2022-10-08 08:49:00 +00:00
|
|
|
}
|
2022-12-10 09:35:24 +00:00
|
|
|
|
|
|
|
assert!(var == 1, "p5 {var}");
|
|
|
|
debug_assert!(var == 1, "p6 {var}");
|
2022-10-08 08:49:00 +00:00
|
|
|
}
|