mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
28 lines
409 B
Rust
28 lines
409 B
Rust
|
// run-rustfix
|
||
|
// edition:2018
|
||
|
|
||
|
#![warn(clippy::uninlined_format_args)]
|
||
|
|
||
|
fn main() {
|
||
|
let var = 1;
|
||
|
|
||
|
println!("val='{var}'");
|
||
|
|
||
|
if var > 0 {
|
||
|
panic!("p1 {}", var);
|
||
|
}
|
||
|
if var > 0 {
|
||
|
panic!("p2 {0}", var);
|
||
|
}
|
||
|
if var > 0 {
|
||
|
panic!("p3 {var}", var = var);
|
||
|
}
|
||
|
|
||
|
#[allow(non_fmt_panics)]
|
||
|
{
|
||
|
if var > 0 {
|
||
|
panic!("p4 {var}");
|
||
|
}
|
||
|
}
|
||
|
}
|