Skip to content

Commit 88fd46e

Browse files
Add regression test
1 parent 2bcbb25 commit 88fd46e

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Checks that undocumented private macros will not generate `missing_docs`
2+
// lints, but public ones will.
3+
//
4+
// This is a regression test for issue #57569
5+
#![deny(missing_docs)]
6+
#![feature(decl_macro)]
7+
//! Empty documentation.
8+
9+
macro new_style_private_macro {
10+
() => ()
11+
}
12+
13+
pub(crate) macro new_style_crate_macro {
14+
() => ()
15+
}
16+
17+
macro_rules! old_style_private_macro {
18+
() => ()
19+
}
20+
21+
mod submodule {
22+
pub macro new_style_macro_in_private_module {
23+
() => ()
24+
}
25+
26+
macro_rules! old_style_mod_private_macro {
27+
() => ()
28+
}
29+
30+
#[macro_export]
31+
macro_rules! exported_to_top_level {
32+
//~^ ERROR missing documentation for macro
33+
() => ()
34+
}
35+
}
36+
37+
pub macro top_level_pub_macro {
38+
//~^ ERROR missing documentation for macro
39+
() => ()
40+
}
41+
42+
/// Empty documentation.
43+
pub fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error: missing documentation for macro
2+
--> $DIR/missing-doc-private-macro.rs:31:5
3+
|
4+
LL | macro_rules! exported_to_top_level {
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/missing-doc-private-macro.rs:5:9
9+
|
10+
LL | #![deny(missing_docs)]
11+
| ^^^^^^^^^^^^
12+
13+
error: missing documentation for macro
14+
--> $DIR/missing-doc-private-macro.rs:37:1
15+
|
16+
LL | pub macro top_level_pub_macro {
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
19+
error: aborting due to 2 previous errors
20+

0 commit comments

Comments
 (0)