Skip to content

Commit

Permalink
Workaround rustc bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarcho committed Oct 2, 2022
1 parent 38236a7 commit 817dc11
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clippy_utils/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,15 +859,16 @@ impl<'tcx> FormatArgsExpn<'tcx> {
pub fn find_nested(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>, expn_id: ExpnId) -> Option<Self> {
for_each_expr(expr, |e| {
let e_ctxt = e.span.ctxt();
if e_ctxt == expr.span.ctxt() {
let res = 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 {
ControlFlow::Continue(Descend::No)
}
};
res
})
}

Expand Down

0 comments on commit 817dc11

Please sign in to comment.