mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-22 02:53:20 +00:00
a7fa2a6fa8
Don't lint on a mixture of raw and regular strings Fix spans in format strings
106 lines
2.2 KiB
Text
106 lines
2.2 KiB
Text
error: literal with an empty format string
|
|
--> $DIR/write_literal_2.rs:9:28
|
|
|
|
|
LL | writeln!(&mut v, "{}", "{hello}");
|
|
| ^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::write-literal` implied by `-D warnings`
|
|
help: try this
|
|
|
|
|
LL | writeln!(&mut v, "{{hello}}");
|
|
| ^^^^^^^^^--
|
|
|
|
error: literal with an empty format string
|
|
--> $DIR/write_literal_2.rs:10:29
|
|
|
|
|
LL | writeln!(&mut v, r"{}", r"{hello}");
|
|
| ^^^^^^^^^^
|
|
|
|
|
help: try this
|
|
|
|
|
LL | writeln!(&mut v, r"{{hello}}");
|
|
| ^^^^^^^^^--
|
|
|
|
error: literal with an empty format string
|
|
--> $DIR/write_literal_2.rs:11:28
|
|
|
|
|
LL | writeln!(&mut v, "{}", '/'');
|
|
| ^^^^
|
|
|
|
|
help: try this
|
|
|
|
|
LL | writeln!(&mut v, "'");
|
|
| ^--
|
|
|
|
error: literal with an empty format string
|
|
--> $DIR/write_literal_2.rs:12:28
|
|
|
|
|
LL | writeln!(&mut v, "{}", '"');
|
|
| ^^^
|
|
|
|
|
help: try this
|
|
|
|
|
LL | writeln!(&mut v, "/"");
|
|
| ^^--
|
|
|
|
error: literal with an empty format string
|
|
--> $DIR/write_literal_2.rs:14:29
|
|
|
|
|
LL | writeln!(&mut v, r"{}", '/'');
|
|
| ^^^^
|
|
|
|
|
help: try this
|
|
|
|
|
LL | writeln!(&mut v, r"'");
|
|
| ^--
|
|
|
|
error: literal with an empty format string
|
|
--> $DIR/write_literal_2.rs:18:9
|
|
|
|
|
LL | / "hello /
|
|
LL | | world!"
|
|
| |_______________^
|
|
|
|
|
help: try this
|
|
|
|
|
LL | "some hello /
|
|
LL | world!"
|
|
|
|
|
|
|
error: literal with an empty format string
|
|
--> $DIR/write_literal_2.rs:25:9
|
|
|
|
|
LL | "1", "2", "3",
|
|
| ^^^
|
|
|
|
|
help: try this
|
|
|
|
|
LL | "some 1{} / {}", "2", "3",
|
|
| ^ --
|
|
|
|
error: literal with an empty format string
|
|
--> $DIR/write_literal_2.rs:25:14
|
|
|
|
|
LL | "1", "2", "3",
|
|
| ^^^
|
|
|
|
|
help: try this
|
|
|
|
|
LL | 2 / {}",
|
|
LL | "1", "3",
|
|
|
|
|
|
|
error: literal with an empty format string
|
|
--> $DIR/write_literal_2.rs:25:19
|
|
|
|
|
LL | "1", "2", "3",
|
|
| ^^^
|
|
|
|
|
help: try this
|
|
|
|
|
LL | {} / 3",
|
|
LL | "1", "2",
|
|
|
|
|
|
|
error: aborting due to 9 previous errors
|
|
|