2021-03-25 13:29:11 -05:00
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:10:23
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2022-01-27 08:12:45 -06:00
|
|
|
LL | writeln!(v, "{}", "{hello}");
|
|
|
|
| ^^^^^^^^^
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::write-literal` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::write_literal)]`
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2022-01-27 08:12:45 -06:00
|
|
|
LL - writeln!(v, "{}", "{hello}");
|
|
|
|
LL + writeln!(v, "{{hello}}");
|
2022-06-15 06:15:54 -05:00
|
|
|
|
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:13:24
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2022-01-27 08:12:45 -06:00
|
|
|
LL | writeln!(v, r"{}", r"{hello}");
|
|
|
|
| ^^^^^^^^^^
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2022-01-27 08:12:45 -06:00
|
|
|
LL - writeln!(v, r"{}", r"{hello}");
|
|
|
|
LL + writeln!(v, r"{{hello}}");
|
2022-06-15 06:15:54 -05:00
|
|
|
|
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:15:23
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | writeln!(v, "{}", '\'');
|
2022-01-27 08:12:45 -06:00
|
|
|
| ^^^^
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL - writeln!(v, "{}", '\'');
|
2022-01-27 08:12:45 -06:00
|
|
|
LL + writeln!(v, "'");
|
2022-06-15 06:15:54 -05:00
|
|
|
|
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:17:23
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2022-01-27 08:12:45 -06:00
|
|
|
LL | writeln!(v, "{}", '"');
|
|
|
|
| ^^^
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2022-01-27 08:12:45 -06:00
|
|
|
LL - writeln!(v, "{}", '"');
|
2023-08-24 14:32:12 -05:00
|
|
|
LL + writeln!(v, "\"");
|
2022-06-15 06:15:54 -05:00
|
|
|
|
|
2021-03-25 13:29:11 -05:00
|
|
|
|
2022-09-21 12:02:37 -05:00
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:19:24
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
|
|
|
LL | writeln!(v, r"{}", '"');
|
|
|
|
| ^^^
|
|
|
|
|
2021-03-25 13:29:11 -05:00
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:21:24
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | writeln!(v, r"{}", '\'');
|
2022-01-27 08:12:45 -06:00
|
|
|
| ^^^^
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL - writeln!(v, r"{}", '\'');
|
2022-01-27 08:12:45 -06:00
|
|
|
LL + writeln!(v, r"'");
|
2022-06-15 06:15:54 -05:00
|
|
|
|
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:26:9
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | / "hello \
|
2023-10-06 10:35:45 -05:00
|
|
|
LL | | world!",
|
2021-03-25 13:29:11 -05:00
|
|
|
| |_______________^
|
|
|
|
|
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL ~ "some hello \
|
2023-10-06 10:35:45 -05:00
|
|
|
LL ~ world!",
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:34:9
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-10-06 10:35:45 -05:00
|
|
|
LL | "1", "2", "3",
|
|
|
|
| ^^^^^^^^^^^^^
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL ~ "some 1\
|
2023-10-06 10:35:45 -05:00
|
|
|
LL ~ 2 \\ 3",
|
2021-03-21 09:29:21 -05:00
|
|
|
|
|
2021-03-25 13:29:11 -05:00
|
|
|
|
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:36:23
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | writeln!(v, "{}", "\\");
|
2022-09-21 12:02:37 -05:00
|
|
|
| ^^^^
|
|
|
|
|
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL - writeln!(v, "{}", "\\");
|
|
|
|
LL + writeln!(v, "\\");
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:38:24
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | writeln!(v, r"{}", "\\");
|
2022-09-21 12:02:37 -05:00
|
|
|
| ^^^^
|
|
|
|
|
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL - writeln!(v, r"{}", "\\");
|
|
|
|
LL + writeln!(v, r"\");
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:40:26
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | writeln!(v, r#"{}"#, "\\");
|
2022-09-21 12:02:37 -05:00
|
|
|
| ^^^^
|
|
|
|
|
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL - writeln!(v, r#"{}"#, "\\");
|
|
|
|
LL + writeln!(v, r#"\"#);
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:42:23
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | writeln!(v, "{}", r"\");
|
2022-09-21 12:02:37 -05:00
|
|
|
| ^^^^
|
|
|
|
|
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL - writeln!(v, "{}", r"\");
|
|
|
|
LL + writeln!(v, "\\");
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:44:23
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | writeln!(v, "{}", "\r");
|
2022-09-21 12:02:37 -05:00
|
|
|
| ^^^^
|
|
|
|
|
|
2023-07-17 03:19:29 -05:00
|
|
|
help: try
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL - writeln!(v, "{}", "\r");
|
|
|
|
LL + writeln!(v, "\r");
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: literal with an empty format string
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/write_literal_2.rs:47:28
|
2022-09-21 12:02:37 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | writeln!(v, r#"{}{}"#, '#', '"');
|
2023-10-06 10:35:45 -05:00
|
|
|
| ^^^^^^^^
|
2022-09-21 12:02:37 -05:00
|
|
|
|
2023-10-06 10:35:45 -05:00
|
|
|
error: aborting due to 14 previous errors
|
2021-03-25 13:29:11 -05:00
|
|
|
|