- if let ExprKind::Lit(ref lit) = args[0].kind;
- if let LitKind::Str(ref s, _) = lit.node;
- let panic_message = s.as_str(); // bind the panic message
- if let ExprKind::AddrOf(MutImmutable, ref inner) = args[1].kind;
- if let ExprKind::Tup(ref elements) = inner.kind;
- if elements.len() == 3;
- if let ExprKind::Lit(ref lit1) = elements[0].kind;
- if let LitKind::Str(ref s1, _) = lit1.node;
- if let ExprKind::Lit(ref lit2) = elements[1].kind;
- if let LitKind::Int(_, _) = lit2.node;
- if let ExprKind::Lit(ref lit3) = elements[2].kind;
- if let LitKind::Int(_, _) = lit3.node;
- // arm 2 block
- if let PatKind::Wild = arms[1].pat.kind;
- if let ExprKind::Block(ref block2, _) = arms[1].body.kind;
- if let None = &block2.expr;
- if block2.stmts.len() == 0;
+ // bind the second argument of the `assert!` macro if it exists
+ if let panic_message = snippet_opt(cx, args[0].span);
+ // second argument of begin_panic is irrelevant
+ // as is the second match arm