]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax_ext/format.rs
Rollup merge of #34436 - jseyfried:no_block_expr, r=eddyb
[rust.git] / src / libsyntax_ext / format.rs
index 5be2bf7cdf92b7b374c976160cf0a987fc59ef69..f311f16f11b0efbebd7c59390f75102f537c171b 100644 (file)
@@ -449,7 +449,7 @@ fn static_array(ecx: &mut ExtCtxt,
         };
 
         // Wrap the declaration in a block so that it forms a single expression.
-        ecx.expr_block(ecx.block(sp, vec![stmt], Some(ecx.expr_ident(sp, name))))
+        ecx.expr_block(ecx.block(sp, vec![stmt, ecx.stmt_expr(ecx.expr_ident(sp, name))]))
     }
 
     /// Actually builds the expression which the iformat! block will be expanded