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#113785 - GuillaumeGomez:tests/rustdoc/issue…
…-105735-fix, r=notriddle,aDotInTheVoid Fix invalid display of inlined re-export when both local and foreign items are inlined Fixes rust-lang#105735. The bug is actually quite interesting: at the `clean` pass, local inlined items have their `use` item removed, however foreign items don't have their `use` item removed because it's in the `clean` pass that we handle them. So when a `use` inlines both a local and a foreign item, it will work as expected for the foreign one, but not for the local as its `use` should not be around anymore. To prevent this, I created a new `inlined_foreigns` field into the `Module` struct to allow to remove the `use` item early on for foreign items as well. Then we iterate it in the `clean` pass directly. r? ``@notriddle``
- Loading branch information
Showing
4 changed files
with
87 additions
and
17 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
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,25 @@ | ||
// Regression test to ensure that both `AtomicU8` items are displayed but not the re-export. | ||
|
||
#![crate_name = "foo"] | ||
#![no_std] | ||
|
||
// @has 'foo/index.html' | ||
// @has - '//*[@class="item-name"]/a[@class="type"]' 'AtomicU8' | ||
// @has - '//*[@class="item-name"]/a[@class="constant"]' 'AtomicU8' | ||
// We also ensure we don't have another item displayed. | ||
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 2 | ||
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Type Definitions' | ||
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Constants' | ||
|
||
mod other { | ||
pub type AtomicU8 = (); | ||
} | ||
|
||
mod thing { | ||
pub use crate::other::AtomicU8; | ||
|
||
#[allow(non_upper_case_globals)] | ||
pub const AtomicU8: () = (); | ||
} | ||
|
||
pub use crate::thing::AtomicU8; |
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,21 @@ | ||
// Regression test to ensure that both `AtomicU8` items are displayed but not the re-export. | ||
|
||
#![crate_name = "foo"] | ||
#![no_std] | ||
|
||
// @has 'foo/index.html' | ||
// @has - '//*[@class="item-name"]/a[@class="struct"]' 'AtomicU8' | ||
// @has - '//*[@class="item-name"]/a[@class="constant"]' 'AtomicU8' | ||
// We also ensure we don't have another item displayed. | ||
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 2 | ||
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Structs' | ||
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Constants' | ||
|
||
mod thing { | ||
pub use core::sync::atomic::AtomicU8; | ||
|
||
#[allow(non_upper_case_globals)] | ||
pub const AtomicU8: () = (); | ||
} | ||
|
||
pub use crate::thing::AtomicU8; |