forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#99344 - notriddle:notriddle/multiple-macro-…
…rules-w-same-name, r=GuillaumeGomez rustdoc: avoid inlining items with duplicate `(type, name)` Fixes rust-lang#99221
- Loading branch information
Showing
5 changed files
with
107 additions
and
5 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,20 @@ | ||
pub struct Option; | ||
impl Option { | ||
pub fn unwrap(self) {} | ||
} | ||
|
||
mod macros { | ||
use crate::Option; | ||
/// [`Option::unwrap`] | ||
#[macro_export] | ||
macro_rules! print { | ||
() => () | ||
} | ||
} | ||
|
||
mod structs { | ||
use crate::Option; | ||
/// [`Option::unwrap`] | ||
pub struct Print; | ||
} | ||
pub use structs::Print; |
19 changes: 19 additions & 0 deletions
19
src/test/rustdoc/issue-99221-multiple-macro-rules-w-same-name-submodule.rs
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 @@ | ||
// aux-build:issue-99221-aux.rs | ||
// build-aux-docs | ||
// ignore-cross-compile | ||
|
||
#![crate_name = "foo"] | ||
|
||
#[macro_use] | ||
extern crate issue_99221_aux; | ||
|
||
pub use issue_99221_aux::*; | ||
|
||
// @count foo/index.html '//a[@class="macro"]' 1 | ||
|
||
mod inner { | ||
#[macro_export] | ||
macro_rules! print { | ||
() => () | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/test/rustdoc/issue-99221-multiple-macro-rules-w-same-name.rs
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 @@ | ||
// aux-build:issue-99221-aux.rs | ||
// build-aux-docs | ||
// ignore-cross-compile | ||
|
||
#![crate_name = "foo"] | ||
|
||
#[macro_use] | ||
extern crate issue_99221_aux; | ||
|
||
pub use issue_99221_aux::*; | ||
|
||
// @count foo/index.html '//a[@class="macro"]' 1 | ||
|
||
#[macro_export] | ||
macro_rules! print { | ||
() => () | ||
} |
14 changes: 14 additions & 0 deletions
14
src/test/rustdoc/issue-99221-multiple-structs-w-same-name.rs
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,14 @@ | ||
// aux-build:issue-99221-aux.rs | ||
// build-aux-docs | ||
// ignore-cross-compile | ||
|
||
#![crate_name = "foo"] | ||
|
||
#[macro_use] | ||
extern crate issue_99221_aux; | ||
|
||
pub use issue_99221_aux::*; | ||
|
||
// @count foo/index.html '//a[@class="struct"][@title="foo::Print struct"]' 1 | ||
|
||
pub struct Print; |