]>
Commit | Line | Data |
---|---|---|
3dfed10e | 1 | // check-pass |
6a06907d | 2 | // aux-build:pin-project-internal-0.4.0.rs |
3dfed10e XL |
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; | |
6a06907d XL |
27 | impl_macros!(Foo); //~ WARN using an old version |
28 | //~| WARN this was previously | |
6c58768f XL |
29 | arrays!(Foo); |
30 | other!(Foo); | |
3dfed10e XL |
31 | } |
32 | ||
6c58768f XL |
33 | mod with_version { |
34 | include!("js-sys-0.3.17/src/lib.rs"); | |
35 | include!("time-macros-impl-0.1.0/src/lib.rs"); | |
36 | ||
37 | macro_rules! other { | |
38 | ($name:ident) => { | |
39 | #[my_macro] struct Three($name); | |
40 | } | |
41 | } | |
42 | ||
3dfed10e | 43 | struct Foo; |
6a06907d XL |
44 | impl_macros!(Foo); //~ WARN using an old version |
45 | //~| WARN this was previously | |
3dfed10e XL |
46 | arrays!(Foo); |
47 | other!(Foo); | |
48 | } | |
6c58768f | 49 | |
29967ef6 XL |
50 | mod actix_web_test { |
51 | include!("actix-web/src/extract.rs"); | |
52 | ||
53 | struct Foo; | |
6a06907d XL |
54 | tuple_from_req!(Foo); //~ WARN using an old version |
55 | //~| WARN this was previously | |
29967ef6 XL |
56 | } |
57 | ||
58 | mod actix_web_version_test { | |
59 | include!("actix-web-2.0.0/src/extract.rs"); | |
60 | ||
61 | struct Foo; | |
6a06907d XL |
62 | tuple_from_req!(Foo); //~ WARN using an old version |
63 | //~| WARN this was previously | |
29967ef6 XL |
64 | } |
65 | ||
66 | mod actori_web_test { | |
67 | include!("actori-web/src/extract.rs"); | |
68 | ||
69 | struct Foo; | |
70 | tuple_from_req!(Foo); | |
71 | } | |
72 | ||
73 | mod actori_web_version_test { | |
74 | include!("actori-web-2.0.0/src/extract.rs"); | |
75 | ||
76 | struct Foo; | |
77 | tuple_from_req!(Foo); | |
78 | } | |
79 | ||
6c58768f XL |
80 | |
81 | fn main() {} |