]> git.lizzy.rs Git - rust.git/blob - tests/ui/proc-macro/gen-macro-rules-hygiene.rs
Rollup merge of #106591 - Ezrashaw:attempted-integer-identifer, r=Estebank
[rust.git] / tests / ui / proc-macro / gen-macro-rules-hygiene.rs
1 // `macro_rules` items produced by transparent macros have correct hygiene in basic cases.
2 // Local variables and labels are hygienic, items are not hygienic.
3 // `$crate` refers to the crate that defines `macro_rules` and not the outer transparent macro.
4
5 // aux-build:gen-macro-rules-hygiene.rs
6
7 #[macro_use]
8 extern crate gen_macro_rules_hygiene;
9
10 struct ItemUse;
11
12 gen_macro_rules!();
13 //~^ ERROR use of undeclared label `'label_use`
14 //~| ERROR cannot find value `local_use` in this scope
15
16 fn main() {
17     'label_use: loop {
18         let local_use = 1;
19         generated!();
20         ItemDef; // OK
21         local_def; //~ ERROR cannot find value `local_def` in this scope
22     }
23 }