forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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#89867 - Urgau:fix-double-definition, r=Guil…
…laumeGomez Fix macro_rules! duplication when reexported in the same module This can append if within the same module a `#[macro_export] macro_rules!` is declared but also a reexport of itself producing two export of the same macro in the same module. In that case we only want to document it once. Before: ``` Module { is_crate: true, items: [ Id("0:4"), // pub use crate::repro as repro2; Id("0:3"), // macro_rules! repro Id("0:3"), // duplicate, same as above ], } ``` After: ``` Module { is_crate: true, items: [ Id("0:4"), // pub use crate::repro as repro2; Id("0:3"), // macro_rules! repro ], } ``` Fixes rust-lang#89852
- Loading branch information
Showing
3 changed files
with
42 additions
and
3 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,17 @@ | ||
// edition:2018 | ||
|
||
#![no_core] | ||
#![feature(no_core)] | ||
|
||
// @count macro.json "$.index[*][?(@.name=='macro')].inner.items[*]" 2 | ||
|
||
// @set repro_id = macro.json "$.index[*][?(@.name=='repro')].id" | ||
// @has - "$.index[*][?(@.name=='macro')].inner.items[*]" $repro_id | ||
#[macro_export] | ||
macro_rules! repro { | ||
() => {}; | ||
} | ||
|
||
// @set repro2_id = macro.json "$.index[*][?(@.inner.name=='repro2')].id" | ||
// @has - "$.index[*][?(@.name=='macro')].inner.items[*]" $repro2_id | ||
pub use crate::repro as repro2; |
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 @@ | ||
// edition:2018 | ||
|
||
#![no_core] | ||
#![feature(no_core)] | ||
|
||
// @matches 'issue_89852/sidebar-items.js' '"repro"' | ||
// @!matches 'issue_89852/sidebar-items.js' '"repro".*"repro"' | ||
|
||
#[macro_export] | ||
macro_rules! repro { | ||
() => {}; | ||
} | ||
|
||
pub use crate::repro as repro2; |