-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustdoc: Mark imported items as retained
Fixes a bug where impl of items that were imported from a private module would be striped Fixes #100252 Fixes #100242
- Loading branch information
1 parent
cc4dd6f
commit 44b489f
Showing
2 changed files
with
35 additions
and
1 deletion.
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,24 @@ | ||
// https://github.com/rust-lang/rust/issues/100252 | ||
|
||
#![feature(no_core)] | ||
#![no_core] | ||
|
||
mod bar { | ||
// @set baz = import_from_private.json "$.index[*][?(@.kind=='struct')].id" | ||
pub struct Baz; | ||
// @set impl = - "$.index[*][?(@.kind=='impl')].id" | ||
impl Baz { | ||
// @set doit = - "$.index[*][?(@.kind=='method')].id" | ||
pub fn doit() {} | ||
} | ||
} | ||
|
||
// @set import = - "$.index[*][?(@.kind=='import')].id" | ||
pub use bar::Baz; | ||
|
||
// FIXME(adotinthevoid): Use hasexact once #99474 lands | ||
|
||
// @has - "$.index[*][?(@.kind=='module')].inner.items[*]" $import | ||
// @is - "$.index[*][?(@.kind=='import')].inner.id" $baz | ||
// @has - "$.index[*][?(@.kind=='struct')].inner.impls[*]" $impl | ||
// @has - "$.index[*][?(@.kind=='impl')].inner.items[*]" $doit |