]> git.proxmox.com Git - rustc.git/blame - src/test/ui/proc-macro/crate-var.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / proc-macro / crate-var.rs
CommitLineData
416331ca 1// run-pass
476ff2be 2// aux-build:double.rs
94b46f34 3// aux-build:external-crate-var.rs
1a4d82fc 4
476ff2be
SL
5#![allow(unused)]
6
7#[macro_use]
8extern crate double;
94b46f34
XL
9#[macro_use]
10extern crate external_crate_var;
476ff2be
SL
11
12struct Foo;
13
94b46f34
XL
14trait Trait {
15 const CONST: u32;
16 type Assoc;
17}
18
19impl Trait for Foo {
20 const CONST: u32 = 0;
21 type Assoc = Foo;
22}
23
24macro_rules! local { () => {
25 // derive_Double outputs secondary copies of each definition
26 // to test what the proc_macro sees.
27 mod bar {
28 #[derive(Double)]
29 struct Bar($crate::Foo);
30 }
31
32 mod qself {
33 #[derive(Double)]
34 struct QSelf(<::Foo as $crate::Trait>::Assoc);
35 }
36
37 mod qself_recurse {
38 #[derive(Double)]
39 struct QSelfRecurse(<<$crate::Foo as $crate::Trait>::Assoc as $crate::Trait>::Assoc);
40 }
41
42 mod qself_in_const {
43 #[derive(Double)]
44 #[repr(u32)]
45 enum QSelfInConst {
46 Variant = <::Foo as $crate::Trait>::CONST,
47 }
48 }
476ff2be 49} }
94b46f34
XL
50
51mod local {
52 local!();
53}
54
55// and now repeat the above tests, using a macro defined in another crate
56
57mod external {
58 external!{}
59}
9e0c209e
SL
60
61fn main() {}