]> git.lizzy.rs Git - rust.git/blob - src/test/ui/proc-macro/group-compat-hack/group-compat-hack.rs
Rollup merge of #75837 - GuillaumeGomez:fix-font-color-help-button, r=Cldfire
[rust.git] / src / test / ui / proc-macro / group-compat-hack / group-compat-hack.rs
1 // check-pass
2 // aux-build:group-compat-hack.rs
3 // compile-flags: -Z span-debug
4
5 #![no_std] // Don't load unnecessary hygiene information from std
6 extern crate std;
7
8 #[macro_use] extern crate group_compat_hack;
9
10 // Tests the backwards compatibility hack added for certain macros
11 // When an attribute macro named `proc_macro_hack` or `wasm_bindgen`
12 // has an `NtIdent` named `$name`, we pass a plain `Ident` token in
13 // place of a `None`-delimited group. This allows us to maintain
14 // backwards compatibility for older versions of these crates.
15
16 include!("js-sys/src/lib.rs");
17 include!("time-macros-impl/src/lib.rs");
18
19 macro_rules! other {
20     ($name:ident) => {
21         #[my_macro] struct Three($name);
22     }
23 }
24
25 fn main() {
26     struct Foo;
27     impl_macros!(Foo);
28     arrays!(Foo);
29     other!(Foo);
30 }