From 26bb36636ca9d71958055e05053946d22fcfbdbb Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Sun, 2 Oct 2022 17:11:10 -0400 Subject: [PATCH] Workaround rustc bug --- clippy_utils/src/macros.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/clippy_utils/src/macros.rs b/clippy_utils/src/macros.rs index c0b87cd175ec..dda21b903901 100644 --- a/clippy_utils/src/macros.rs +++ b/clippy_utils/src/macros.rs @@ -861,10 +861,12 @@ impl<'tcx> FormatArgsExpn<'tcx> { let e_ctxt = e.span.ctxt(); if e_ctxt == expr.span.ctxt() { ControlFlow::Continue(Descend::Yes) - } else if e_ctxt.outer_expn().is_descendant_of(expn_id) - && let Some(args) = FormatArgsExpn::parse(cx, e) - { - ControlFlow::Break(args) + } else if e_ctxt.outer_expn().is_descendant_of(expn_id) { + if let Some(args) = FormatArgsExpn::parse(cx, e) { + ControlFlow::Break(args) + } else { + ControlFlow::Continue(Descend::No) + } } else { ControlFlow::Continue(Descend::No) }