From 4fdc81dd7a3fb6a563c22d37db72b991cdbb403d Mon Sep 17 00:00:00 2001 From: flip1995 Date: Sat, 17 Mar 2018 20:35:20 +0100 Subject: [PATCH] Check if the panic message was created by the assert-macro --- clippy_lints/src/panic.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/clippy_lints/src/panic.rs b/clippy_lints/src/panic.rs index 9430e59ac86..a768565518c 100644 --- a/clippy_lints/src/panic.rs +++ b/clippy_lints/src/panic.rs @@ -48,6 +48,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass { if let Some(par) = string.as_str().find('{'); if string.as_str()[par..].contains('}'); if params[0].span.source_callee().is_none(); + if params[0].span.lo() != params[0].span.hi(); then { span_lint(cx, PANIC_PARAMS, params[0].span, "you probably are missing some parameter in your format string");