forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgroup-compat-hack.rs
More file actions
30 lines (24 loc) · 800 Bytes
/
Copy pathgroup-compat-hack.rs
File metadata and controls
30 lines (24 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// check-pass
// aux-build:group-compat-hack.rs
// compile-flags: -Z span-debug
#![no_std] // Don't load unnecessary hygiene information from std
extern crate std;
#[macro_use] extern crate group_compat_hack;
// Tests the backwards compatibility hack added for certain macros
// When an attribute macro named `proc_macro_hack` or `wasm_bindgen`
// has an `NtIdent` named `$name`, we pass a plain `Ident` token in
// place of a `None`-delimited group. This allows us to maintain
// backwards compatibility for older versions of these crates.
include!("js-sys/src/lib.rs");
include!("time-macros-impl/src/lib.rs");
macro_rules! other {
($name:ident) => {
#[my_macro] struct Three($name);
}
}
fn main() {
struct Foo;
impl_macros!(Foo);
arrays!(Foo);
other!(Foo);
}