]> git.lizzy.rs Git - rust.git/blob - src/test/ui/macros/macro-with-braces-in-expr-position.rs
Auto merge of #83152 - guswynn:jemallocator_part2, r=Mark-Simulacrum
[rust.git] / src / test / ui / macros / macro-with-braces-in-expr-position.rs
1 // run-pass
2 #![allow(unused_must_use)]
3 // ignore-emscripten no threads support
4
5 use std::thread;
6
7 macro_rules! expr { ($e: expr) => { $e } }
8
9 macro_rules! spawn {
10     ($($code: tt)*) => {
11         expr!(thread::spawn(move|| {$($code)*}).join())
12     }
13 }
14
15 pub fn main() {
16     spawn! {
17         println!("stmt");
18     };
19     let _ = spawn! {
20         println!("expr");
21     };
22 }