]>
git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/print_with_newline.rs
1 // FIXME: Ideally these suggestions would be fixed via rustfix. Blocked by rust-lang/rust#53934
4 #![allow(clippy::print_literal)]
5 #![warn(clippy::print_with_newline)]
9 print
!("Hello {}\n", "world");
10 print
!("Hello {} {}\n", "world", "#2");
19 println
!("Hello {}\n", "world");
20 print
!("Issue\n{}", 1265);
24 print
!("like eof\n\n");
25 print
!("Hello {} {}\n\n", "world", "#2");
26 println
!("\ndon't\nwarn\nfor\nmultiple\nnewlines\n"); // #3126
27 println
!("\nbla\n\n"); // #3126
30 print
!("\\n"); // #3514
31 print
!("\\\n"); // should fail
35 print
!(r
"\n"); // #3778
37 // Literal newlines should also fail
47 // Don't warn on CRLF (#4208)
50 print
!("\\r\n"); //~ ERROR
53 // Ignore expanded format strings
54 macro_rules
! newline
{