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