@@ -524,28 +524,12 @@ impl FormatArgsExpn<'tcx> {
524
524
if let ExpnKind :: Macro ( _, name) = expr. span. ctxt( ) . outer_expn_data( ) . kind;
525
525
let name = name. as_str( ) ;
526
526
if name. ends_with( "format_args" ) || name. ends_with( "format_args_nl" ) ;
527
-
528
- if let ExprKind :: Match ( inner_match, [ arm] , _) = expr. kind;
529
-
530
- // `match match`, if you will
531
- if let ExprKind :: Match ( args, [ inner_arm] , _) = inner_match. kind;
532
- if let ExprKind :: Tup ( value_args) = args. kind;
533
- if let Some ( value_args) = value_args
534
- . iter( )
535
- . map( |e| match e. kind {
536
- ExprKind :: AddrOf ( _, _, e) => Some ( e) ,
537
- _ => None ,
538
- } )
539
- . collect( ) ;
540
- if let ExprKind :: Array ( args) = inner_arm. body. kind;
541
-
542
- if let ExprKind :: Block ( Block { stmts: [ ] , expr: Some ( expr) , .. } , _) = arm. body. kind;
543
- if let ExprKind :: Call ( _, call_args) = expr. kind;
544
- if let Some ( ( strs_ref, fmt_expr) ) = match call_args {
527
+ if let ExprKind :: Call ( _, args) = expr. kind;
528
+ if let Some ( ( strs_ref, args, fmt_expr) ) = match args {
545
529
// Arguments::new_v1
546
- [ strs_ref, _ ] => Some ( ( strs_ref, None ) ) ,
530
+ [ strs_ref, args ] => Some ( ( strs_ref, args , None ) ) ,
547
531
// Arguments::new_v1_formatted
548
- [ strs_ref, _ , fmt_expr] => Some ( ( strs_ref, Some ( fmt_expr) ) ) ,
532
+ [ strs_ref, args , fmt_expr, _unsafe_arg ] => Some ( ( strs_ref, args , Some ( fmt_expr) ) ) ,
549
533
_ => None ,
550
534
} ;
551
535
if let ExprKind :: AddrOf ( BorrowKind :: Ref , _, strs_arr) = strs_ref. kind;
@@ -561,6 +545,17 @@ impl FormatArgsExpn<'tcx> {
561
545
None
562
546
} )
563
547
. collect( ) ;
548
+ if let ExprKind :: AddrOf ( BorrowKind :: Ref , _, args) = args. kind;
549
+ if let ExprKind :: Match ( args, [ arm] , _) = args. kind;
550
+ if let ExprKind :: Tup ( value_args) = args. kind;
551
+ if let Some ( value_args) = value_args
552
+ . iter( )
553
+ . map( |e| match e. kind {
554
+ ExprKind :: AddrOf ( _, _, e) => Some ( e) ,
555
+ _ => None ,
556
+ } )
557
+ . collect( ) ;
558
+ if let ExprKind :: Array ( args) = arm. body. kind;
564
559
then {
565
560
Some ( FormatArgsExpn {
566
561
format_string_span: strs_ref. span,
0 commit comments