diff options
| author | Jason Newcomb <jsnewcomb@pm.me> | 2022-10-02 17:11:10 -0400 |
|---|---|---|
| committer | Jason Newcomb <jsnewcomb@pm.me> | 2022-10-02 17:54:44 -0400 |
| commit | 26bb36636ca9d71958055e05053946d22fcfbdbb (patch) | |
| tree | 6bf52e692593d836420fa05c4d34706cab08d89a | |
| parent | 38236a713512d0a70d1f03e995201d9bac63c882 (diff) | |
| download | rust-26bb36636ca9d71958055e05053946d22fcfbdbb.tar.gz rust-26bb36636ca9d71958055e05053946d22fcfbdbb.zip | |
Workaround rustc bug
| -rw-r--r-- | clippy_utils/src/macros.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clippy_utils/src/macros.rs b/clippy_utils/src/macros.rs index c0b87cd175e..dda21b90390 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) } |
