Re:Rust 1.58.0
by DrMeepster on Thursday January 13, 2022 @02:34PM
(#29925609)
This can never happen with regular string literals. String literals have the type `&'static str` but formatting returns a `String`.
[ Parent
| on HN ]
Perhaps something could be done with compile-time code execution, but the bigger problem is that it wouldn't be backwards-compatible. Currently "{foo}" is a perfectly valid string that doesn't evaluate anything.