We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4e9d8f commit 29a8015Copy full SHA for 29a8015
src/comp/front/extfmt.rs
@@ -74,11 +74,12 @@ fn expr_to_str(@ast::expr expr) -> str {
74
case (ast::lit_str(?s)) {
75
ret s;
76
}
77
+ case (_) { /* fallthrough */ }
78
79
80
81
- // FIXME: Handle error correctly.
- log_err "malformed #fmt call";
82
+ log_err "first argument to #fmt must be a string literal";
83
fail;
84
85
src/test/compile-fail/extfmt-non-literal.rs
@@ -0,0 +1,9 @@
1
+// xfail-stage0
2
+// error-pattern: literal
3
+
4
+fn main() {
5
+ // #fmt's first argument must be a literal. Hopefully this
6
+ // restriction can be eased eventually to just require a
7
+ // compile-time constant.
8
+ auto x = #fmt("a" + "b");
9
+}
0 commit comments