Fix/Issue11932: assert* in multi-condition after unrolling will cause lint emit warning
This commit is contained in:
parent
0153ca95ae
commit
090c228873
@ -502,6 +502,8 @@ impl<'a, 'tcx> Visitor<'tcx> for NotSimplificationVisitor<'a, 'tcx> {
|
||||
&& !inner.span.from_expansion()
|
||||
&& let Some(suggestion) = simplify_not(self.cx, inner)
|
||||
&& self.cx.tcx.lint_level_at_node(NONMINIMAL_BOOL, expr.hir_id).0 != Level::Allow
|
||||
&& let Some(snippet) = snippet_opt(self.cx, expr.span)
|
||||
&& !snippet.contains("assert")
|
||||
{
|
||||
span_lint_and_sugg(
|
||||
self.cx,
|
||||
|
Loading…
x
Reference in New Issue
Block a user