]>
git.proxmox.com Git - rustc.git/blob - tests/rustdoc/macro_pub_in_module.rs
4fd85d68994019602ff49ac54420d8d4512e39ad
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 // @!has external_crate/macro.external_macro.html
12 extern crate external_crate
;
15 // @has krate/inner/macro.raw_const.html
16 // @!has krate/macro.raw_const.html
17 pub macro raw_const() {}
19 // @has krate/inner/macro.test.html
20 // @!has krate/macro.test.html
21 #[rustc_builtin_macro]
22 pub macro test($item
:item
) {}
24 // @has krate/inner/macro.Clone.html
25 // @!has krate/macro.Clone.html
26 #[rustc_builtin_macro]
27 pub macro Clone($item
:item
) {}
29 // Make sure the logic is not affected by re-exports.
31 // @!has krate/macro.unrenamed.html
32 #[rustc_macro_transparency = "semitransparent"]
33 pub macro unrenamed() {}
35 // @has krate/inner/macro.unrenamed.html
36 pub use unrenamed
::unrenamed
;
39 // @!has krate/macro.m.html
42 // @has krate/inner/macro.renamed.html
43 // @!has krate/macro.renamed.html
44 pub use private
::m
as renamed
;
47 // @!has krate/macro.m2.html
50 use private2
as renamed_mod
;
51 // @has krate/inner/macro.m2.html
52 pub use renamed_mod
::m2
;
54 // @has krate/inner/macro.external_macro.html
55 // @!has krate/macro.external_macro.html
56 pub use ::external_crate
::some_module
::external_macro
;
59 // Namespaces: Make sure the logic does not mix up a function name with a module nameā¦
60 fn both_fn_and_mod() {
61 // @!has krate/macro.in_both_fn_and_mod.html
62 pub macro in_both_fn_and_mod() {}
64 pub mod both_fn_and_mod
{
65 // @!has krate/both_fn_and_mod/macro.in_both_fn_and_mod.html
69 // @!has krate/macro.in_both_const_and_mod.html
70 pub macro in_both_const_and_mod() {}
73 // @!has krate/__/macro.in_both_const_and_mod.html
78 // @!has krate/macro.this_is_getting_weird.html;
79 pub macro this_is_getting_weird() {}