Skip to content

Commit 80c4323

Browse files
Add test to ensure that compiler built-in proc-macro are considered as such
1 parent 5e51b2d commit 80c4323

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This test ensures that compiler builtin proc-macros are considered as such.
2+
3+
#![crate_name = "foo"]
4+
5+
// @has 'foo/index.html'
6+
// Each compiler builtin proc-macro has a trait equivalent so we should have
7+
// a trait section as well.
8+
// @count - '//*[@id="main-content"]//*[@class="small-section-header"]' 2
9+
// @has - '//*[@id="main-content"]//*[@class="small-section-header"]' 'Traits'
10+
// @has - '//*[@id="main-content"]//*[@class="small-section-header"]' 'Derive Macros'
11+
12+
// Now checking the correct file is generated as well.
13+
// @has 'foo/derive.Clone.html'
14+
// @!has 'foo/macro.Clone.html'
15+
pub use std::clone::Clone;

tests/rustdoc/macro_pub_in_module.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,26 @@
77
#![crate_name = "krate"]
88
#![no_core]
99

10-
// @has external_crate/some_module/macro.external_macro.html
11-
// @!has external_crate/macro.external_macro.html
10+
// @has external_crate/some_module/macro.external_macro.html
11+
// @!has external_crate/macro.external_macro.html
1212
extern crate external_crate;
1313

1414
pub mod inner {
1515
// @has krate/inner/macro.raw_const.html
1616
// @!has krate/macro.raw_const.html
1717
pub macro raw_const() {}
1818

19-
// @has krate/inner/macro.test.html
19+
// @has krate/inner/attr.test.html
2020
// @!has krate/macro.test.html
21+
// @!has krate/inner/macro.test.html
22+
// @!has krate/attr.test.html
2123
#[rustc_builtin_macro]
2224
pub macro test($item:item) {}
2325

24-
// @has krate/inner/macro.Clone.html
26+
// @has krate/inner/derive.Clone.html
27+
// @!has krate/inner/macro.Clone.html
2528
// @!has krate/macro.Clone.html
29+
// @!has krate/derive.Clone.html
2630
#[rustc_builtin_macro]
2731
pub macro Clone($item:item) {}
2832

0 commit comments

Comments
 (0)