@@ -846,26 +846,28 @@ impl<'a, 'b> Context<'a, 'b> {
846846
847847 let args_slice = self . ecx . expr_addr_of ( self . macsp , args_match) ;
848848
849- // Now create the fmt::Arguments struct with all our locals we created.
850- let ( fn_name, fn_args) = if self . all_pieces_simple {
851- ( "new_v1" , vec ! [ pieces, args_slice] )
852- } else {
853- // Build up the static array which will store our precompiled
854- // nonstandard placeholders, if there are any.
855- let fmt = self . ecx . expr_vec_slice ( self . macsp , self . pieces ) ;
856-
849+ let unsafe_arg = {
857850 let path = self . ecx . std_path ( & [ sym:: fmt, sym:: UnsafeArg , sym:: new] ) ;
858851 let unsafe_arg = self . ecx . expr_call_global ( self . macsp , path, Vec :: new ( ) ) ;
859- let unsafe_expr = self . ecx . expr_block ( P ( ast:: Block {
852+ self . ecx . expr_block ( P ( ast:: Block {
860853 stmts : vec ! [ self . ecx. stmt_expr( unsafe_arg) ] ,
861854 id : ast:: DUMMY_NODE_ID ,
862855 rules : BlockCheckMode :: Unsafe ( UnsafeSource :: CompilerGenerated ) ,
863856 span : self . macsp ,
864857 tokens : None ,
865858 could_be_bare_literal : false ,
866- } ) ) ;
859+ } ) )
860+ } ;
861+
862+ // Now create the fmt::Arguments struct with all our locals we created.
863+ let ( fn_name, fn_args) = if self . all_pieces_simple {
864+ ( "new_v1" , vec ! [ pieces, args_slice, unsafe_arg] )
865+ } else {
866+ // Build up the static array which will store our precompiled
867+ // nonstandard placeholders, if there are any.
868+ let fmt = self . ecx . expr_vec_slice ( self . macsp , self . pieces ) ;
867869
868- ( "new_v1_formatted" , vec ! [ pieces, args_slice, fmt, unsafe_expr ] )
870+ ( "new_v1_formatted" , vec ! [ pieces, args_slice, fmt, unsafe_arg ] )
869871 } ;
870872
871873 let path = self . ecx . std_path ( & [ sym:: fmt, sym:: Arguments , Symbol :: intern ( fn_name) ] ) ;
0 commit comments