2015-11-23 14:06:51 -06:00
|
|
|
// (typeof used because it's surprisingly hard to find an unparsed token after a stmt)
|
|
|
|
macro_rules! m {
|
2016-04-20 18:03:29 -05:00
|
|
|
() => ( i ; typeof ); //~ ERROR expected expression, found reserved keyword `typeof`
|
2015-11-23 14:06:51 -06:00
|
|
|
//~| ERROR macro expansion ignores token `typeof`
|
|
|
|
//~| ERROR macro expansion ignores token `;`
|
|
|
|
//~| ERROR macro expansion ignores token `;`
|
2020-03-17 02:55:28 -05:00
|
|
|
//~| ERROR cannot find type `i` in this scope
|
|
|
|
//~| ERROR cannot find value `i` in this scope
|
2021-07-22 14:28:02 -05:00
|
|
|
//~| WARN trailing semicolon in macro
|
|
|
|
//~| WARN this was previously
|
2015-11-23 14:06:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2017-12-10 14:29:24 -06:00
|
|
|
let a: m!();
|
|
|
|
let i = m!();
|
2015-11-23 14:06:51 -06:00
|
|
|
match 0 {
|
2017-12-10 14:29:24 -06:00
|
|
|
m!() => {}
|
2015-11-23 14:06:51 -06:00
|
|
|
}
|
|
|
|
|
2017-12-10 14:29:24 -06:00
|
|
|
m!();
|
2015-11-23 14:06:51 -06:00
|
|
|
}
|