Skip to content

Commit b9a85b3

Browse files
Update tests
1 parent 5c5fdef commit b9a85b3

6 files changed

+58
-5
lines changed
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Checks that private macros are documented when `--document-private-items`
2+
// is present.
3+
//
4+
// This is a regression test for issue #73754.
5+
//
6+
// compile-flags: --document-private-items
7+
8+
#![feature(decl_macro)]
9+
10+
11+
// @has macro_document_private/macro.some_macro.html
12+
macro some_macro {
13+
(a: tt) => {}
14+
}
15+
16+
// @has macro_document_private/macro.another_macro.html
17+
macro_rules! another_macro {
18+
(a: tt) => {}
19+
}
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Checks that it is possible to make a macro public through a `pub use` of its
2+
// parent module.
3+
//
4+
// This is a regression test for issue #87257.
5+
6+
#![feature(decl_macro)]
7+
8+
mod outer {
9+
pub mod inner {
10+
pub macro some_macro() {}
11+
}
12+
}
13+
14+
// @has macro_indirect_use/inner/index.html
15+
// @has macro_indirect_use/inner/macro.some_macro.html
16+
pub use outer::inner;
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Checks that you can set a lint level specficially for a macro definition.
2+
//
3+
// This is a regression test for issue #59306.
4+
//
5+
// check-pass
6+
7+
8+
#[deny(missing_docs)]
9+
mod module {
10+
#[allow(missing_docs)]
11+
#[macro_export]
12+
macro_rules! hello {
13+
() => ()
14+
}
15+
}
16+
17+
fn main() {}

src/test/ui/lint/missing-doc-private-macro.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ mod submodule {
2929

3030
#[macro_export]
3131
macro_rules! exported_to_top_level {
32-
//~^ ERROR missing documentation for macro
32+
//~^ ERROR missing documentation for a macro
3333
() => ()
3434
}
3535
}
3636

3737
pub macro top_level_pub_macro {
38-
//~^ ERROR missing documentation for macro
38+
//~^ ERROR missing documentation for a macro
3939
() => ()
4040
}
4141

src/test/ui/lint/missing-doc-private-macro.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: missing documentation for macro
1+
error: missing documentation for a macro
22
--> $DIR/missing-doc-private-macro.rs:31:5
33
|
44
LL | macro_rules! exported_to_top_level {
@@ -10,7 +10,7 @@ note: the lint level is defined here
1010
LL | #![deny(missing_docs)]
1111
| ^^^^^^^^^^^^
1212

13-
error: missing documentation for macro
13+
error: missing documentation for a macro
1414
--> $DIR/missing-doc-private-macro.rs:37:1
1515
|
1616
LL | pub macro top_level_pub_macro {

src/test/ui/macros/macro-stability-rpass.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// run-pass
22
// aux-build:unstable-macros.rs
33

4-
#![feature(unstable_macros, local_unstable)]
4+
#![unstable(feature = "one_two_three_testing", issue = "none")]
5+
#![feature(staged_api, unstable_macros, local_unstable)]
56

67
#[macro_use] extern crate unstable_macros;
78

0 commit comments

Comments
 (0)