Skip to content

Commit 090c228

Browse files
committedJan 3, 2024
Fix/Issue11932: assert* in multi-condition after unrolling will cause lint emit warning
1 parent 0153ca9 commit 090c228

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

Diff for: ‎clippy_lints/src/booleans.rs

+2
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,8 @@ impl<'a, 'tcx> Visitor<'tcx> for NotSimplificationVisitor<'a, 'tcx> {
502502
&& !inner.span.from_expansion()
503503
&& let Some(suggestion) = simplify_not(self.cx, inner)
504504
&& self.cx.tcx.lint_level_at_node(NONMINIMAL_BOOL, expr.hir_id).0 != Level::Allow
505+
&& let Some(snippet) = snippet_opt(self.cx, expr.span)
506+
&& !snippet.contains("assert")
505507
{
506508
span_lint_and_sugg(
507509
self.cx,

0 commit comments

Comments
 (0)