Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
inquisitivecrystal committed Aug 14, 2021
1 parent 5c5fdef commit b9a85b3
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 5 deletions.
19 changes: 19 additions & 0 deletions src/test/rustdoc/macro-document-private.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Checks that private macros are documented when `--document-private-items`
// is present.
//
// This is a regression test for issue #73754.
//
// compile-flags: --document-private-items

#![feature(decl_macro)]


// @has macro_document_private/macro.some_macro.html
macro some_macro {
(a: tt) => {}
}

// @has macro_document_private/macro.another_macro.html
macro_rules! another_macro {
(a: tt) => {}
}
16 changes: 16 additions & 0 deletions src/test/rustdoc/macro-indirect-use.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Checks that it is possible to make a macro public through a `pub use` of its
// parent module.
//
// This is a regression test for issue #87257.

#![feature(decl_macro)]

mod outer {
pub mod inner {
pub macro some_macro() {}
}
}

// @has macro_indirect_use/inner/index.html
// @has macro_indirect_use/inner/macro.some_macro.html
pub use outer::inner;
17 changes: 17 additions & 0 deletions src/test/ui/lint/lint-level-macro-def.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Checks that you can set a lint level specficially for a macro definition.
//
// This is a regression test for issue #59306.
//
// check-pass


#[deny(missing_docs)]
mod module {
#[allow(missing_docs)]
#[macro_export]
macro_rules! hello {
() => ()
}
}

fn main() {}
4 changes: 2 additions & 2 deletions src/test/ui/lint/missing-doc-private-macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ mod submodule {

#[macro_export]
macro_rules! exported_to_top_level {
//~^ ERROR missing documentation for macro
//~^ ERROR missing documentation for a macro
() => ()
}
}

pub macro top_level_pub_macro {
//~^ ERROR missing documentation for macro
//~^ ERROR missing documentation for a macro
() => ()
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/lint/missing-doc-private-macro.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: missing documentation for macro
error: missing documentation for a macro
--> $DIR/missing-doc-private-macro.rs:31:5
|
LL | macro_rules! exported_to_top_level {
Expand All @@ -10,7 +10,7 @@ note: the lint level is defined here
LL | #![deny(missing_docs)]
| ^^^^^^^^^^^^

error: missing documentation for macro
error: missing documentation for a macro
--> $DIR/missing-doc-private-macro.rs:37:1
|
LL | pub macro top_level_pub_macro {
Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/macros/macro-stability-rpass.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// run-pass
// aux-build:unstable-macros.rs

#![feature(unstable_macros, local_unstable)]
#![unstable(feature = "one_two_three_testing", issue = "none")]
#![feature(staged_api, unstable_macros, local_unstable)]

#[macro_use] extern crate unstable_macros;

Expand Down

0 comments on commit b9a85b3

Please sign in to comment.