-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f7bce0
commit b5a4141
Showing
9 changed files
with
99 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// FIXME: If two macros in the same module have the same name | ||
// (yes, that's a thing), rustdoc lists both of them on the index page, | ||
// but only documents the first one on the page for the macro. | ||
// Fortunately, this can only happen in document private items mode, | ||
// but it still isn't ideal beahvior. | ||
// | ||
// See https://github.com/rust-lang/rust/pull/88019#discussion_r693920453 | ||
// | ||
// compile-flags: --document-private-items | ||
|
||
// @has macro_document_private_duplicate/index.html 'Doc 1.' | ||
// @has macro_document_private_duplicate/macro.a_macro.html 'Doc 1.' | ||
/// Doc 1. | ||
macro_rules! a_macro { | ||
() => () | ||
} | ||
|
||
// @has macro_document_private_duplicate/index.html 'Doc 2.' | ||
// @!has macro_document_private_duplicate/macro.a_macro.html 'Doc 2.' | ||
/// Doc 2. | ||
macro_rules! a_macro { | ||
() => () | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) => {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// This checks that exported macros lint as part of their module of origin, not | ||
// the root module. | ||
// | ||
// check-pass | ||
|
||
//! Top level documentation | ||
#![deny(missing_docs)] | ||
|
||
#[allow(missing_docs)] | ||
mod module { | ||
#[macro_export] | ||
macro_rules! hello { | ||
() => () | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters