2018-07-23 00:19:07 +02:00
|
|
|
error: literal with an empty format string
|
2022-09-21 13:02:37 -04:00
|
|
|
--> $DIR/write_literal.rs:31:27
|
2018-04-04 20:46:39 -07:00
|
|
|
|
|
2022-01-27 15:12:45 +01:00
|
|
|
LL | write!(v, "Hello {}", "world");
|
|
|
|
| ^^^^^^^
|
2021-01-30 18:06:34 +01:00
|
|
|
|
|
|
|
|
= note: `-D clippy::write-literal` implied by `-D warnings`
|
2023-08-01 14:02:21 +02:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::write_literal)]`
|
2023-07-17 10:19:29 +02:00
|
|
|
help: try
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2022-01-27 15:12:45 +01:00
|
|
|
LL - write!(v, "Hello {}", "world");
|
|
|
|
LL + write!(v, "Hello world");
|
2022-06-15 14:15:54 +03:00
|
|
|
|
|
2018-04-21 19:50:49 +01:00
|
|
|
|
2018-07-23 00:19:07 +02:00
|
|
|
error: literal with an empty format string
|
2023-08-24 21:32:12 +02:00
|
|
|
--> $DIR/write_literal.rs:34:39
|
2018-04-21 19:50:49 +01:00
|
|
|
|
|
2022-01-27 15:12:45 +01:00
|
|
|
LL | writeln!(v, "Hello {} {}", world, "world");
|
|
|
|
| ^^^^^^^
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-07-17 10:19:29 +02:00
|
|
|
help: try
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2022-01-27 15:12:45 +01:00
|
|
|
LL - writeln!(v, "Hello {} {}", world, "world");
|
|
|
|
LL + writeln!(v, "Hello {} world", world);
|
2022-06-15 14:15:54 +03:00
|
|
|
|
|
2018-04-04 20:46:39 -07:00
|
|
|
|
2018-07-23 00:19:07 +02:00
|
|
|
error: literal with an empty format string
|
2023-08-24 21:32:12 +02:00
|
|
|
--> $DIR/write_literal.rs:36:29
|
2018-04-04 20:46:39 -07:00
|
|
|
|
|
2022-01-27 15:12:45 +01:00
|
|
|
LL | writeln!(v, "Hello {}", "world");
|
|
|
|
| ^^^^^^^
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-07-17 10:19:29 +02:00
|
|
|
help: try
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2022-01-27 15:12:45 +01:00
|
|
|
LL - writeln!(v, "Hello {}", "world");
|
|
|
|
LL + writeln!(v, "Hello world");
|
2022-06-15 14:15:54 +03:00
|
|
|
|
|
2018-04-04 20:46:39 -07:00
|
|
|
|
2018-07-23 00:19:07 +02:00
|
|
|
error: literal with an empty format string
|
2023-08-24 21:32:12 +02:00
|
|
|
--> $DIR/write_literal.rs:38:29
|
2022-09-21 13:02:37 -04:00
|
|
|
|
|
|
|
|
LL | writeln!(v, "{} {:.4}", "a literal", 5);
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-07-17 10:19:29 +02:00
|
|
|
help: try
|
2022-09-21 13:02:37 -04:00
|
|
|
|
|
|
|
|
LL - writeln!(v, "{} {:.4}", "a literal", 5);
|
|
|
|
LL + writeln!(v, "a literal {:.4}", 5);
|
|
|
|
|
|
|
|
|
|
|
|
|
error: literal with an empty format string
|
2023-08-24 21:32:12 +02:00
|
|
|
--> $DIR/write_literal.rs:44:28
|
2018-04-04 20:46:39 -07:00
|
|
|
|
|
2022-01-27 15:12:45 +01:00
|
|
|
LL | writeln!(v, "{0} {1}", "hello", "world");
|
2023-09-28 17:12:00 +09:00
|
|
|
| ^^^^^^^^^^^^^^^^
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-07-17 10:19:29 +02:00
|
|
|
help: try
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2022-01-27 15:12:45 +01:00
|
|
|
LL - writeln!(v, "{0} {1}", "hello", "world");
|
2023-09-28 17:12:00 +09:00
|
|
|
LL + writeln!(v, "hello world");
|
2022-06-15 14:15:54 +03:00
|
|
|
|
|
2018-04-04 20:46:39 -07:00
|
|
|
|
2018-07-23 00:19:07 +02:00
|
|
|
error: literal with an empty format string
|
2023-09-28 17:12:00 +09:00
|
|
|
--> $DIR/write_literal.rs:46:28
|
2018-04-04 20:46:39 -07:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL | writeln!(v, "{1} {0}", "hello", "world");
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-07-17 10:19:29 +02:00
|
|
|
help: try
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL - writeln!(v, "{1} {0}", "hello", "world");
|
|
|
|
LL + writeln!(v, "world hello");
|
2022-06-15 14:15:54 +03:00
|
|
|
|
|
2018-04-04 20:46:39 -07:00
|
|
|
|
2018-07-23 00:19:07 +02:00
|
|
|
error: literal with an empty format string
|
2023-09-28 17:12:00 +09:00
|
|
|
--> $DIR/write_literal.rs:50:38
|
2018-04-04 20:46:39 -07:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL | writeln!(v, "{foo} {bar}", foo = "hello", bar = "world");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-07-17 10:19:29 +02:00
|
|
|
help: try
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL - writeln!(v, "{foo} {bar}", foo = "hello", bar = "world");
|
|
|
|
LL + writeln!(v, "hello world");
|
2022-06-15 14:15:54 +03:00
|
|
|
|
|
2018-04-04 20:46:39 -07:00
|
|
|
|
2018-07-23 00:19:07 +02:00
|
|
|
error: literal with an empty format string
|
2023-09-28 17:12:00 +09:00
|
|
|
--> $DIR/write_literal.rs:52:38
|
2018-04-04 20:46:39 -07:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL | writeln!(v, "{bar} {foo}", foo = "hello", bar = "world");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-07-17 10:19:29 +02:00
|
|
|
help: try
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL - writeln!(v, "{bar} {foo}", foo = "hello", bar = "world");
|
|
|
|
LL + writeln!(v, "world hello");
|
2022-06-15 14:15:54 +03:00
|
|
|
|
|
2018-04-04 20:46:39 -07:00
|
|
|
|
2018-07-23 00:19:07 +02:00
|
|
|
error: literal with an empty format string
|
2023-09-28 17:12:00 +09:00
|
|
|
--> $DIR/write_literal.rs:56:32
|
2018-04-04 20:46:39 -07:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL | writeln!(v, "{0} {1} {2}", "hello", 2, "world");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-07-17 10:19:29 +02:00
|
|
|
help: try
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL - writeln!(v, "{0} {1} {2}", "hello", 2, "world");
|
|
|
|
LL + writeln!(v, "hello {0} world", 2);
|
2022-06-15 14:15:54 +03:00
|
|
|
|
|
2018-04-04 20:46:39 -07:00
|
|
|
|
2018-07-23 00:19:07 +02:00
|
|
|
error: literal with an empty format string
|
2023-09-28 17:12:00 +09:00
|
|
|
--> $DIR/write_literal.rs:58:32
|
2018-04-04 20:46:39 -07:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL | writeln!(v, "{2} {1} {0}", "hello", 2, "world");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-07-17 10:19:29 +02:00
|
|
|
help: try
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL - writeln!(v, "{2} {1} {0}", "hello", 2, "world");
|
|
|
|
LL + writeln!(v, "world {0} hello", 2);
|
2022-06-15 14:15:54 +03:00
|
|
|
|
|
2018-04-04 20:46:39 -07:00
|
|
|
|
2018-07-23 00:19:07 +02:00
|
|
|
error: literal with an empty format string
|
2023-09-28 17:12:00 +09:00
|
|
|
--> $DIR/write_literal.rs:60:39
|
2018-04-04 20:46:39 -07:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL | writeln!(v, "{0} {1} {2}, {bar}", "hello", 2, 3, bar = 4);
|
|
|
|
| ^^^^^^^
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-07-17 10:19:29 +02:00
|
|
|
help: try
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL - writeln!(v, "{0} {1} {2}, {bar}", "hello", 2, 3, bar = 4);
|
|
|
|
LL + writeln!(v, "hello {0} {1}, {bar}", 2, 3, bar = 4);
|
2022-06-15 14:15:54 +03:00
|
|
|
|
|
2018-04-04 20:46:39 -07:00
|
|
|
|
2018-07-23 00:19:07 +02:00
|
|
|
error: literal with an empty format string
|
2023-09-28 17:12:00 +09:00
|
|
|
--> $DIR/write_literal.rs:62:41
|
2018-04-04 20:46:39 -07:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL | writeln!(v, "{0} {1} {2}, {3} {4}", "hello", 2, 3, "world", 4);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-07-17 10:19:29 +02:00
|
|
|
help: try
|
2021-03-25 19:29:11 +01:00
|
|
|
|
|
2023-09-28 17:12:00 +09:00
|
|
|
LL - writeln!(v, "{0} {1} {2}, {3} {4}", "hello", 2, 3, "world", 4);
|
|
|
|
LL + writeln!(v, "hello {0} {1}, world {2}", 2, 3, 4);
|
2022-06-15 14:15:54 +03:00
|
|
|
|
|
2018-04-04 20:46:39 -07:00
|
|
|
|
2022-09-21 13:02:37 -04:00
|
|
|
error: aborting due to 12 previous errors
|
2018-04-04 20:46:39 -07:00
|
|
|
|