Closed
Description
When the spawn
function was deprecated in favour of std::thread::Thread::spawn
, the following program will produce a warning
fn main() {
spawn(move|| ());
}
Output:
<anon>:11:5: 11:10 warning: use of deprecated item: use std::thread::Thread::spawn and detach instead, #[warn(deprecated)] on by default
<anon>:11 spawn(move|| ());
^~~~~
But if the same call is wrapped in a macro the warning is not emitted, as follows:
#![feature(macro_rules)]
// Short-hand macro for spawn(move|| expr)
macro_rules! go( ($e:expr) => (spawn(move|| $e)) );
fn main() {
go!{ () };
}
Here it is on the playpen
Not sure if this is a bug or not, or if the warning should be emitted, but I would have expected the same warning when the macro is "unwrapped".