|
1 | 1 | // aux-build:macro_pub_in_module.rs
|
2 | 2 | // edition:2018
|
3 | 3 | // build-aux-docs
|
4 |
| -// @has external_crate/some_module/macro.external_macro.html |
5 | 4 |
|
6 | 5 | //! See issue #74355
|
7 | 6 | #![feature(decl_macro, no_core, rustc_attrs)]
|
8 | 7 | #![crate_name = "krate"]
|
9 | 8 | #![no_core]
|
10 | 9 |
|
| 10 | +// @has external_crate/some_module/macro.external_macro.html |
11 | 11 | extern crate external_crate;
|
12 | 12 |
|
13 | 13 | pub mod inner {
|
14 | 14 | // @has krate/inner/macro.raw_const.html
|
| 15 | + // @!has krate/macro.raw_const.html |
15 | 16 | pub macro raw_const() {}
|
16 | 17 |
|
17 | 18 | // @has krate/inner/macro.test.html
|
| 19 | + // @!has krate/macro.test.html |
18 | 20 | #[rustc_builtin_macro]
|
19 | 21 | pub macro test($item:item) {}
|
20 | 22 |
|
21 | 23 | // @has krate/inner/macro.Clone.html
|
| 24 | + // @!has krate/macro.Clone.html |
22 | 25 | #[rustc_builtin_macro]
|
23 | 26 | pub macro Clone($item:item) {}
|
24 | 27 |
|
25 |
| - // Make sure the logic is not affected by a re-export. |
| 28 | + // Make sure the logic is not affected by re-exports. |
| 29 | + mod unrenamed { |
| 30 | + // @!has krate/macro.unrenamed.html |
| 31 | + #[rustc_macro_transparency = "semitransparent"] |
| 32 | + pub macro unrenamed() {} |
| 33 | + } |
| 34 | + // @has krate/inner/macro.unrenamed.html |
| 35 | + pub use unrenamed::unrenamed; |
| 36 | + |
26 | 37 | mod private {
|
| 38 | + // @!has krate/macro.m.html |
27 | 39 | pub macro m() {}
|
28 | 40 | }
|
29 | 41 | // @has krate/inner/macro.renamed.html
|
| 42 | + // @!has krate/macro.renamed.html |
30 | 43 | pub use private::m as renamed;
|
31 | 44 |
|
| 45 | + mod private2 { |
| 46 | + // @!has krate/macro.m2.html |
| 47 | + pub macro m2() {} |
| 48 | + } |
| 49 | + use private2 as renamed_mod; |
| 50 | + // @has krate/inner/macro.m2.html |
| 51 | + pub use renamed_mod::m2; |
| 52 | + |
32 | 53 | // @has krate/inner/macro.external_macro.html
|
| 54 | + // @!has krate/macro.external_macro.html |
33 | 55 | pub use ::external_crate::some_module::external_macro;
|
34 | 56 | }
|
35 | 57 |
|
36 | 58 | // Namespaces: Make sure the logic does not mix up a function name with a module name…
|
37 | 59 | fn both_fn_and_mod() {
|
38 |
| - pub macro m() {} |
| 60 | + // @!has krate/macro.in_both_fn_and_mod.html |
| 61 | + pub macro in_both_fn_and_mod() {} |
39 | 62 | }
|
40 | 63 | pub mod both_fn_and_mod {
|
41 |
| - // @!has krate/both_fn_and_mod/macro.m.html |
| 64 | + // @!has krate/both_fn_and_mod/macro.in_both_fn_and_mod.html |
42 | 65 | }
|
43 | 66 |
|
44 | 67 | const __: () = {
|
45 |
| - pub macro m() {} |
| 68 | + // @!has krate/macro.in_both_const_and_mod.html |
| 69 | + pub macro in_both_const_and_mod() {} |
46 | 70 | };
|
47 | 71 | pub mod __ {
|
48 |
| - // @!has krate/__/macro.m.html |
| 72 | + // @!has krate/__/macro.in_both_const_and_mod.html |
49 | 73 | }
|
0 commit comments