Skip to content

Commit 28e9c67

Browse files
Update test assertions (showcases bug)
1 parent aa863ca commit 28e9c67

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

src/test/rustdoc/auxiliary/macro_pub_in_module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ pub mod some_module {
88
mod private {
99
pub macro external_macro() {}
1010
}
11-
// @has external_crate/some_module/macro.external_macro.html
11+
1212
pub use private::external_macro;
1313
}
Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,73 @@
11
// aux-build:macro_pub_in_module.rs
22
// edition:2018
33
// build-aux-docs
4-
// @has external_crate/some_module/macro.external_macro.html
54

65
//! See issue #74355
76
#![feature(decl_macro, no_core, rustc_attrs)]
87
#![crate_name = "krate"]
98
#![no_core]
109

10+
// @has external_crate/some_module/macro.external_macro.html
1111
extern crate external_crate;
1212

1313
pub mod inner {
1414
// @has krate/inner/macro.raw_const.html
15+
// @!has krate/macro.raw_const.html
1516
pub macro raw_const() {}
1617

1718
// @has krate/inner/macro.test.html
19+
// @!has krate/macro.test.html
1820
#[rustc_builtin_macro]
1921
pub macro test($item:item) {}
2022

2123
// @has krate/inner/macro.Clone.html
24+
// @!has krate/macro.Clone.html
2225
#[rustc_builtin_macro]
2326
pub macro Clone($item:item) {}
2427

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+
2637
mod private {
38+
// @!has krate/macro.m.html
2739
pub macro m() {}
2840
}
2941
// @has krate/inner/macro.renamed.html
42+
// @!has krate/macro.renamed.html
3043
pub use private::m as renamed;
3144

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+
3253
// @has krate/inner/macro.external_macro.html
54+
// @!has krate/macro.external_macro.html
3355
pub use ::external_crate::some_module::external_macro;
3456
}
3557

3658
// Namespaces: Make sure the logic does not mix up a function name with a module name…
3759
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() {}
3962
}
4063
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
4265
}
4366

4467
const __: () = {
45-
pub macro m() {}
68+
// @!has krate/macro.in_both_const_and_mod.html
69+
pub macro in_both_const_and_mod() {}
4670
};
4771
pub mod __ {
48-
// @!has krate/__/macro.m.html
72+
// @!has krate/__/macro.in_both_const_and_mod.html
4973
}

0 commit comments

Comments
 (0)