]> git.lizzy.rs Git - rust.git/blob - src/test/ui/macros/macro-context.rs
Merge commit 'e36a20c24f35a4cee82bbdc600289104c9237c22' into ra-sync-and-pms-component
[rust.git] / src / test / ui / macros / macro-context.rs
1 // (typeof used because it's surprisingly hard to find an unparsed token after a stmt)
2 macro_rules! m {
3     () => ( i ; typeof );   //~ ERROR expected expression, found reserved keyword `typeof`
4                             //~| ERROR macro expansion ignores token `typeof`
5                             //~| ERROR macro expansion ignores token `;`
6                             //~| ERROR macro expansion ignores token `;`
7                             //~| ERROR cannot find type `i` in this scope
8                             //~| ERROR cannot find value `i` in this scope
9                             //~| WARN trailing semicolon in macro
10                             //~| WARN this was previously
11 }
12
13 fn main() {
14     let a: m!();
15     let i = m!();
16     match 0 {
17         m!() => {}
18     }
19
20     m!();
21 }