Fix false-positive in panic_params

It might still have false positives, but it’s even less likely.
This commit is contained in:
mcarton 2016-03-12 21:23:01 +01:00
parent 7eef989ff4
commit 0774b203f4
2 changed files with 19 additions and 4 deletions

View file

@ -37,7 +37,8 @@ impl LateLintPass for PanicPass {
match_path(path, &BEGIN_UNWIND),
let ExprLit(ref lit) = params[0].node,
let LitKind::Str(ref string, _) = lit.node,
string.contains('{'),
let Some(par) = string.find('{'),
string[par..].contains('}'),
let Some(sp) = cx.sess().codemap()
.with_expn_info(expr.span.expn_id,
|info| info.map(|i| i.call_site))