1 // aux-build:macro_pub_in_module.rs
6 #![feature(decl_macro, no_core, rustc_attrs)]
7 #![crate_name = "krate"]
10 // @has external_crate/some_module/macro.external_macro.html
11 extern crate external_crate;
14 // @has krate/inner/macro.raw_const.html
15 // @!has krate/macro.raw_const.html
16 pub macro raw_const() {}
18 // @has krate/inner/macro.test.html
19 // @!has krate/macro.test.html
20 #[rustc_builtin_macro]
21 pub macro test($item:item) {}
23 // @has krate/inner/macro.Clone.html
24 // @!has krate/macro.Clone.html
25 #[rustc_builtin_macro]
26 pub macro Clone($item:item) {}
28 // Make sure the logic is not affected by re-exports.
30 // @!has krate/macro.unrenamed.html
31 #[rustc_macro_transparency = "semitransparent"]
32 pub macro unrenamed() {}
34 // @has krate/inner/macro.unrenamed.html
35 pub use unrenamed::unrenamed;
38 // @!has krate/macro.m.html
41 // @has krate/inner/macro.renamed.html
42 // @!has krate/macro.renamed.html
43 pub use private::m as renamed;
46 // @!has krate/macro.m2.html
49 use private2 as renamed_mod;
50 // @has krate/inner/macro.m2.html
51 pub use renamed_mod::m2;
53 // @has krate/inner/macro.external_macro.html
54 // @!has krate/macro.external_macro.html
55 pub use ::external_crate::some_module::external_macro;
58 // Namespaces: Make sure the logic does not mix up a function name with a module nameā¦
59 fn both_fn_and_mod() {
60 // @!has krate/macro.in_both_fn_and_mod.html
61 pub macro in_both_fn_and_mod() {}
63 pub mod both_fn_and_mod {
64 // @!has krate/both_fn_and_mod/macro.in_both_fn_and_mod.html
68 // @!has krate/macro.in_both_const_and_mod.html
69 pub macro in_both_const_and_mod() {}
72 // @!has krate/__/macro.in_both_const_and_mod.html