]>
Commit | Line | Data |
---|---|---|
3dfed10e XL |
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 | ||
6c58768f XL |
16 | mod no_version { |
17 | include!("js-sys/src/lib.rs"); | |
18 | include!("time-macros-impl/src/lib.rs"); | |
3dfed10e | 19 | |
6c58768f XL |
20 | macro_rules! other { |
21 | ($name:ident) => { | |
22 | #[my_macro] struct Three($name); | |
23 | } | |
3dfed10e | 24 | } |
6c58768f XL |
25 | |
26 | struct Foo; | |
27 | impl_macros!(Foo); | |
28 | arrays!(Foo); | |
29 | other!(Foo); | |
3dfed10e XL |
30 | } |
31 | ||
6c58768f XL |
32 | mod with_version { |
33 | include!("js-sys-0.3.17/src/lib.rs"); | |
34 | include!("time-macros-impl-0.1.0/src/lib.rs"); | |
35 | ||
36 | macro_rules! other { | |
37 | ($name:ident) => { | |
38 | #[my_macro] struct Three($name); | |
39 | } | |
40 | } | |
41 | ||
3dfed10e XL |
42 | struct Foo; |
43 | impl_macros!(Foo); | |
44 | arrays!(Foo); | |
45 | other!(Foo); | |
46 | } | |
6c58768f | 47 | |
29967ef6 XL |
48 | mod actix_web_test { |
49 | include!("actix-web/src/extract.rs"); | |
50 | ||
51 | struct Foo; | |
52 | tuple_from_req!(Foo); | |
53 | } | |
54 | ||
55 | mod actix_web_version_test { | |
56 | include!("actix-web-2.0.0/src/extract.rs"); | |
57 | ||
58 | struct Foo; | |
59 | tuple_from_req!(Foo); | |
60 | } | |
61 | ||
62 | mod actori_web_test { | |
63 | include!("actori-web/src/extract.rs"); | |
64 | ||
65 | struct Foo; | |
66 | tuple_from_req!(Foo); | |
67 | } | |
68 | ||
69 | mod actori_web_version_test { | |
70 | include!("actori-web-2.0.0/src/extract.rs"); | |
71 | ||
72 | struct Foo; | |
73 | tuple_from_req!(Foo); | |
74 | } | |
75 | ||
6c58768f XL |
76 | |
77 | fn main() {} |