-
Notifications
You must be signed in to change notification settings - Fork 13k
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 #103653 - GuillaumeGomez:missing-impl-private-json, r…
…=notriddle Add missing impl blocks for item reexported from private mod in JSON output Fixes #102583. Since we don't inline for the JSON output, the impl blocks from private modules are not present when we generate the output. To go around this limitation, in case the impl block doesn't have `#[doc(hidden)]` and is implementing a public item, we don't strip it. cc `@fmease` `@aDotInTheVoid` r? `@notriddle`
- Loading branch information
Showing
2 changed files
with
53 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
28 changes: 28 additions & 0 deletions
28
src/test/rustdoc-json/reexport/reexport_method_from_private_module.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,28 @@ | ||
// Regression test for <https://github.com/rust-lang/rust/issues/102583>. | ||
|
||
// @set impl_S = "$.index[*][?(@.docs=='impl S')].id" | ||
// @has "$.index[*][?(@.name=='S')].inner.impls[*]" $impl_S | ||
// @set is_present = "$.index[*][?(@.name=='is_present')].id" | ||
// @is "$.index[*][?(@.docs=='impl S')].inner.items[*]" $is_present | ||
// @!has "$.index[*][?(@.name=='hidden_impl')]" | ||
// @!has "$.index[*][?(@.name=='hidden_fn')]" | ||
|
||
#![no_std] | ||
|
||
mod private_mod { | ||
pub struct S; | ||
|
||
/// impl S | ||
impl S { | ||
pub fn is_present() {} | ||
#[doc(hidden)] | ||
pub fn hidden_fn() {} | ||
} | ||
|
||
#[doc(hidden)] | ||
impl S { | ||
pub fn hidden_impl() {} | ||
} | ||
} | ||
|
||
pub use private_mod::*; |