]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/explicit_write.fixed
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / explicit_write.fixed
index 692d2ca675f91ac6712d46be511934876151e9bd..862c3fea9ee82aa9baf2448904469ce806e05537 100644 (file)
@@ -1,6 +1,7 @@
 // run-rustfix
-#![allow(unused_imports)]
 #![warn(clippy::explicit_write)]
+#![allow(unused_imports)]
+#![allow(clippy::uninlined_format_args)]
 
 fn stdout() -> String {
     String::new()
@@ -10,6 +11,12 @@ fn stderr() -> String {
     String::new()
 }
 
+macro_rules! one {
+    () => {
+        1
+    };
+}
+
 fn main() {
     // these should warn
     {
@@ -24,6 +31,14 @@ fn main() {
         // including newlines
         println!("test\ntest");
         eprintln!("test\ntest");
+
+        let value = 1;
+        eprintln!("with {}", value);
+        eprintln!("with {} {}", 2, value);
+        eprintln!("with {value}");
+        eprintln!("macro arg {}", one!());
+        let width = 2;
+        eprintln!("{:w$}", value, w = width);
     }
     // these should not warn, different destination
     {