blob: 4607349e96368e187b6884cfbfd46119049ed2c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
//@ run-pass
#![allow(unused_must_use)]
//@ needs-threads
use std::thread;
macro_rules! expr { ($e: expr) => { $e } }
macro_rules! spawn {
($($code: tt)*) => {
expr!(thread::spawn(move|| {$($code)*}).join())
}
}
pub fn main() {
spawn! {
println!("stmt");
};
let _ = spawn! {
println!("expr");
};
}
|