Skip to content

Commit dd37b3e

Browse files
committed
---
yaml --- r: 2788 b: refs/heads/master c: 29a8015 h: refs/heads/master v: v3
1 parent 56ccf6e commit dd37b3e

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: c4e9d8fb911a2e70162c7f61ac70e11c2f604650
2+
refs/heads/master: 29a801565a52d530d7c0c30c823d56aca0c00044

trunk/src/comp/front/extfmt.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ fn expr_to_str(@ast::expr expr) -> str {
7474
case (ast::lit_str(?s)) {
7575
ret s;
7676
}
77+
case (_) { /* fallthrough */ }
7778
}
7879
}
80+
case (_) { /* fallthrough */ }
7981
}
80-
// FIXME: Handle error correctly.
81-
log_err "malformed #fmt call";
82+
log_err "first argument to #fmt must be a string literal";
8283
fail;
8384
}
8485

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)