Debian Codegraph @

tests/items.rs

raw symbols SCIP
1 /*
2 Copyright ⓒ 2016 macro-attr contributors.
3
4 Licensed under the MIT license (see LICENSE or <http://opensource.org
5 /licenses/MIT>) or the Apache License, Version 2.0 (see LICENSE of
6 <http://www.apache.org/licenses/LICENSE-2.0>), at your option. All
7 files in the project carrying such notice may not be copied, modified,
8 or distributed except according to those terms.
9 */
10 #[macro_use] extern crate macro_attr;
11
12 macro_attr! {
13 const DUMMY_CONST: () = ();
14 }
15
16 macro_attr! {
17 enum DummyEnum { V }
18 }
19
20 macro_attr! {
21 fn dummy_fn() {}
22 }
23
24 macro_attr! {
25 impl DummyStruct {
26 fn f(self) {}
27 }
28 }
29
30 macro_attr! {
31 mod dummy_mod {
32 pub fn f() {}
33 }
34 }
35
36 macro_attr! {
37 static DUMMY_STATIC: () = ();
38 }
39
40 macro_attr! {
41 struct DummyStruct;
42 }
43
44 macro_attr! {
45 trait DummyTrait {}
46 }
47
48 macro_attr! {
49 type DummyType = ();
50 }
51
52 macro_attr! {
53 use self::dummy_fn as dummy_use;
54 }
55
56 #[cfg(never)]
57 mod super_dummy {
58 macro_attr! {
59 extern crate dummy_crate;
60 }
61
62 macro_attr! {
63 extern "C" dummy_extern();
64 }
65 }
66
67 #[test]
68 fn test_items() {
69 let _: () = DUMMY_CONST;
70 let _: DummyEnum = DummyEnum::V;
71 let _: () = dummy_fn();
72 let _: () = DummyStruct.f();
73 let _: () = dummy_mod::f();
74 let _: DummyStruct = DummyStruct;
75 let _: Option<&DummyTrait> = None;
76 let _: DummyType = ();
77 let _: () = DUMMY_STATIC;
78 let _: () = dummy_use();
79 }