@@ -448,13 +448,10 @@ pub fn extract_assert_macro_args<'tcx>(e: &'tcx Expr<'tcx>) -> Option<Vec<&'tcx
448448 if args_assert_failed. len( ) >= 4 ;
449449 if let ExprKind :: Call ( _, args) = args_assert_failed[ 3 ] . kind;
450450 if !args. is_empty( ) ;
451- if let ExprKind :: Match ( expr_match, _, _ ) = args[ 0 ] . kind;
452- if let ExprKind :: Match ( tup_match, _, _) = expr_match. kind;
453- if let ExprKind :: Tup ( tup_args_list) = tup_match. kind;
451+ if let Some ( mut format_arg_expn) = FormatArgsExpn :: parse( & args[ 0 ] ) ;
454452 then {
455- for arg in tup_args_list {
456- vec_arg. push( arg) ;
457- }
453+ vec_arg. push( format_arg_expn. format_string) ;
454+ vec_arg. append( & mut format_arg_expn. value_args) ;
458455 }
459456 }
460457 return Some ( vec_arg) ;
@@ -526,6 +523,8 @@ impl FormatExpn<'tcx> {
526523
527524/// A parsed `format_args!` expansion
528525pub struct FormatArgsExpn < ' tcx > {
526+ /// The fist argument, the fromat string, as an expr
527+ pub format_string : & ' tcx Expr < ' tcx > ,
529528 /// Span of the first argument, the format string
530529 pub format_string_span : Span ,
531530 /// Values passed after the format string
@@ -582,6 +581,7 @@ impl FormatArgsExpn<'tcx> {
582581 if let ExprKind :: Array ( args) = arm. body. kind;
583582 then {
584583 Some ( FormatArgsExpn {
584+ format_string: strs_ref,
585585 format_string_span: strs_ref. span,
586586 value_args,
587587 format_string_parts,
0 commit comments