Closed
Description
I wonder if we could make rustc accept code like this:
const y: &str = "hello {}";
let x = format!(y, "world");
Currently this errors with:
error: format argument must be a string literal
--> src/main.rs:3:21
|
3 | let x = format!(y, "world");
| ^
|
help: you might be missing a string literal to format with
|
3 | let x = format!("{} {}", y, "world");
| ^^^^^^^^
rustc 1.43.0-nightly (58b834344 2020-02-05)
Metadata
Metadata
Assignees
Labels
No labels