@@ -446,13 +446,10 @@ pub fn extract_assert_macro_args<'tcx>(e: &'tcx Expr<'tcx>) -> Option<Vec<&'tcx
446446 if args_assert_failed. len( ) >= 4 ;
447447 if let ExprKind :: Call ( _, args) = args_assert_failed[ 3 ] . kind;
448448 if !args. is_empty( ) ;
449- if let ExprKind :: Match ( expr_match, _, _ ) = args[ 0 ] . kind;
450- if let ExprKind :: Match ( tup_match, _, _) = expr_match. kind;
451- if let ExprKind :: Tup ( tup_args_list) = tup_match. kind;
449+ if let Some ( mut format_arg_expn) = FormatArgsExpn :: parse( & args[ 0 ] ) ;
452450 then {
453- for arg in tup_args_list {
454- vec_arg. push( arg) ;
455- }
451+ vec_arg. push( format_arg_expn. format_string) ;
452+ vec_arg. append( & mut format_arg_expn. value_args) ;
456453 }
457454 }
458455 return Some ( vec_arg) ;
@@ -524,6 +521,8 @@ impl FormatExpn<'tcx> {
524521
525522/// A parsed `format_args!` expansion
526523pub struct FormatArgsExpn < ' tcx > {
524+ /// The fist argument, the fromat string, as an expr
525+ pub format_string : & ' tcx Expr < ' tcx > ,
527526 /// Span of the first argument, the format string
528527 pub format_string_span : Span ,
529528 /// Values passed after the format string
@@ -585,6 +584,7 @@ impl FormatArgsExpn<'tcx> {
585584 . collect( ) ;
586585 then {
587586 Some ( FormatArgsExpn {
587+ format_string: strs_ref,
588588 format_string_span: strs_ref. span,
589589 value_args,
590590 format_string_parts,
0 commit comments