@@ -846,26 +846,28 @@ impl<'a, 'b> Context<'a, 'b> {
846
846
847
847
let args_slice = self . ecx . expr_addr_of ( self . macsp , args_match) ;
848
848
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 = {
857
850
let path = self . ecx . std_path ( & [ sym:: fmt, sym:: UnsafeArg , sym:: new] ) ;
858
851
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 {
860
853
stmts : vec ! [ self . ecx. stmt_expr( unsafe_arg) ] ,
861
854
id : ast:: DUMMY_NODE_ID ,
862
855
rules : BlockCheckMode :: Unsafe ( UnsafeSource :: CompilerGenerated ) ,
863
856
span : self . macsp ,
864
857
tokens : None ,
865
858
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 ) ;
867
869
868
- ( "new_v1_formatted" , vec ! [ pieces, args_slice, fmt, unsafe_expr ] )
870
+ ( "new_v1_formatted" , vec ! [ pieces, args_slice, fmt, unsafe_arg ] )
869
871
} ;
870
872
871
873
let path = self . ecx . std_path ( & [ sym:: fmt, sym:: Arguments , Symbol :: intern ( fn_name) ] ) ;
0 commit comments