Files
rust/tests/ui/println_empty_string_unfixable.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

31 lines
680 B
Rust

#![allow(clippy::match_single_binding)]
// If there is a comment in the span of macro call, we don't provide an auto-fix suggestion.
#[rustfmt::skip]
fn issue_16167() {
//~v println_empty_string
println!("" /* comment */);
//~v println_empty_string
eprintln!("" /* comment */);
//~v println_empty_string
println!( // comment
"");
//~v println_empty_string
eprintln!( // comment
"");
//~v println_empty_string
println!("", /* comment */);
//~v println_empty_string
println!(
"\
\
",
// there is a comment in the macro span regardless of its position
);
}