]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hygiene/transparent-basic.rs
Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkov
[rust.git] / src / test / ui / hygiene / transparent-basic.rs
1 // check-pass
2 // aux-build:transparent-basic.rs
3
4 #![feature(decl_macro, rustc_attrs)]
5
6 extern crate transparent_basic;
7
8 #[rustc_macro_transparency = "transparent"]
9 macro binding() {
10     let x = 10;
11 }
12
13 #[rustc_macro_transparency = "transparent"]
14 macro label() {
15     break 'label
16 }
17
18 macro_rules! legacy {
19     () => {
20         binding!();
21         let y = x;
22     }
23 }
24
25 fn legacy_interaction1() {
26     legacy!();
27 }
28
29 struct S;
30
31 fn check_dollar_crate() {
32     // `$crate::S` inside the macro resolves to `S` from this crate.
33     transparent_basic::dollar_crate!();
34 }
35
36 fn main() {
37     binding!();
38     let y = x;
39
40     'label: loop {
41         label!();
42     }
43 }