]> git.proxmox.com Git - rustc.git/blame - src/test/ui/proc-macro/group-compat-hack/group-compat-hack.rs
Update (un)suspicious files
[rustc.git] / src / test / ui / proc-macro / group-compat-hack / group-compat-hack.rs
CommitLineData
6a06907d 1// aux-build:pin-project-internal-0.4.0.rs
3dfed10e
XL
2// compile-flags: -Z span-debug
3
4#![no_std] // Don't load unnecessary hygiene information from std
5extern crate std;
6
7#[macro_use] extern crate group_compat_hack;
8
9// Tests the backwards compatibility hack added for certain macros
10// When an attribute macro named `proc_macro_hack` or `wasm_bindgen`
11// has an `NtIdent` named `$name`, we pass a plain `Ident` token in
12// place of a `None`-delimited group. This allows us to maintain
13// backwards compatibility for older versions of these crates.
14
6c58768f
XL
15mod no_version {
16 include!("js-sys/src/lib.rs");
17 include!("time-macros-impl/src/lib.rs");
3dfed10e 18
6c58768f
XL
19 macro_rules! other {
20 ($name:ident) => {
21 #[my_macro] struct Three($name);
22 }
3dfed10e 23 }
6c58768f
XL
24
25 struct Foo;
3c0e092e 26 impl_macros!(Foo); //~ ERROR using an old version
6a06907d 27 //~| WARN this was previously
6c58768f
XL
28 arrays!(Foo);
29 other!(Foo);
3dfed10e
XL
30}
31
6c58768f
XL
32mod 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 42 struct Foo;
3c0e092e 43 impl_macros!(Foo); //~ ERROR using an old version
6a06907d 44 //~| WARN this was previously
3c0e092e 45 arrays!(Foo); //~ ERROR using an old version
cdc7bbd5 46 //~| WARN this was previously
3dfed10e
XL
47 other!(Foo);
48}
6c58768f 49
29967ef6
XL
50mod actix_web_test {
51 include!("actix-web/src/extract.rs");
52
53 struct Foo;
3c0e092e 54 tuple_from_req!(Foo); //~ ERROR using an old version
6a06907d 55 //~| WARN this was previously
29967ef6
XL
56}
57
58mod actix_web_version_test {
59 include!("actix-web-2.0.0/src/extract.rs");
60
61 struct Foo;
3c0e092e 62 tuple_from_req!(Foo); //~ ERROR using an old version
6a06907d 63 //~| WARN this was previously
29967ef6
XL
64}
65
66mod actori_web_test {
67 include!("actori-web/src/extract.rs");
68
69 struct Foo;
70 tuple_from_req!(Foo);
71}
72
73mod 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
cdc7bbd5
XL
80mod with_good_js_sys_version {
81 include!("js-sys-0.3.40/src/lib.rs");
82 struct Foo;
83 arrays!(Foo);
84}
85
6c58768f
XL
86
87fn main() {}