Files
rust/tests/ui/println_empty_string.rs
T
irelaxcn 675fd681aa Fix println_empty_string suggestion caused error when there is a , after arg.
Make `writeln_empty_string` don't provide an auto-fix suggestion when
there is a comment in the macro call span.
2025-12-20 01:38:31 +08:00

46 lines
842 B
Rust

#![allow(clippy::match_single_binding)]
fn main() {
println!();
println!("");
//~^ println_empty_string
match "a" {
_ => println!(""),
//~^ println_empty_string
}
eprintln!();
eprintln!("");
//~^ println_empty_string
match "a" {
_ => eprintln!(""),
//~^ println_empty_string
}
}
#[rustfmt::skip]
fn issue_16167() {
//~v println_empty_string
println!(
"\
\
"
,
);
match "a" {
_ => println!("" ,), // there is a space between "" and comma
//~^ println_empty_string
}
eprintln!("" ,); // there is a tab between "" and comma
//~^ println_empty_string
match "a" {
_ => eprintln!("" ,), // tab and space between "" and comma
//~^ println_empty_string
}
}