Skip to content

Commit

Permalink
Fix Clippy sync fallout
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Jan 13, 2022
1 parent 159d6c3 commit b83c77c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tools/clippy/clippy_utils/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ impl<'a> PanicExpn<'a> {
if !macro_backtrace(expr.span).any(|macro_call| is_panic(cx, macro_call.def_id)) {
return None;
}
let ExprKind::Call(callee, [arg]) = expr.kind else { return None };
let ExprKind::Path(QPath::Resolved(_, path)) = callee.kind else { return None };
let ExprKind::Call(callee, [arg]) = &expr.kind else { return None };
let ExprKind::Path(QPath::Resolved(_, path)) = &callee.kind else { return None };
let result = match path.segments.last().unwrap().ident.as_str() {
"panic" if arg.span.ctxt() == expr.span.ctxt() => Self::Empty,
"panic" | "panic_str" => Self::Str(arg),
"panic_display" => {
let ExprKind::AddrOf(_, _, e) = arg.kind else { return None };
let ExprKind::AddrOf(_, _, e) = &arg.kind else { return None };
Self::Display(e)
},
"panic_fmt" => Self::Format(FormatArgsExpn::parse(cx, arg)?),
Expand Down

0 comments on commit b83c77c

Please sign in to comment.