2015-11-23 21:06:51 +01:00
|
|
|
// (typeof used because it's surprisingly hard to find an unparsed token after a stmt)
|
|
|
|
macro_rules! m {
|
2016-04-21 02:03:29 +03:00
|
|
|
() => ( i ; typeof ); //~ ERROR expected expression, found reserved keyword `typeof`
|
2015-11-23 21:06:51 +01:00
|
|
|
//~| ERROR macro expansion ignores token `typeof`
|
|
|
|
//~| ERROR macro expansion ignores token `;`
|
|
|
|
//~| ERROR macro expansion ignores token `;`
|
2020-03-17 08:55:28 +01: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 21:06:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2017-12-10 23:29:24 +03:00
|
|
|
let a: m!();
|
|
|
|
let i = m!();
|
2015-11-23 21:06:51 +01:00
|
|
|
match 0 {
|
2017-12-10 23:29:24 +03:00
|
|
|
m!() => {}
|
2015-11-23 21:06:51 +01:00
|
|
|
}
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
m!();
|
2015-11-23 21:06:51 +01:00
|
|
|
}
|