rustc: Fail better when the first argument to #fmt is not a string literal
This commit is contained in:
parent
c4e9d8fb91
commit
29a801565a
2 changed files with 12 additions and 2 deletions
|
|
@ -74,11 +74,12 @@ fn expr_to_str(@ast::expr expr) -> str {
|
|||
case (ast::lit_str(?s)) {
|
||||
ret s;
|
||||
}
|
||||
case (_) { /* fallthrough */ }
|
||||
}
|
||||
}
|
||||
case (_) { /* fallthrough */ }
|
||||
}
|
||||
// FIXME: Handle error correctly.
|
||||
log_err "malformed #fmt call";
|
||||
log_err "first argument to #fmt must be a string literal";
|
||||
fail;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue