]> git.lizzy.rs Git - rust.git/blob - src/test/ui/macros/macro-context.rs
Auto merge of #85020 - lrh2000:named-upvars, r=tmandry
[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 }