20 lines
516 B
Rust
20 lines
516 B
Rust
#![warn(clippy::useless_concat)]
|
|
#![allow(clippy::print_literal)]
|
|
|
|
macro_rules! my_concat {
|
|
($fmt:literal $(, $e:expr)*) => {
|
|
println!(concat!("ERROR: ", $fmt), $($e,)*);
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let x = ""; //~ useless_concat
|
|
let x = "a"; //~ useless_concat
|
|
let x = "1"; //~ useless_concat
|
|
println!("b: {}", "a"); //~ useless_concat
|
|
// Should not lint.
|
|
let x = concat!("a", "b");
|
|
let local_i32 = 1;
|
|
my_concat!("{}", local_i32);
|
|
let x = concat!(file!(), "#L", line!());
|
|
}
|