Commit 7b39994
authored
Rollup merge of #157838 - qaijuang:rustdoc-hidden-aliased-fields, r=GuillaumeGomez,Urgau
rustdoc: Don't strip hidden items in `AliasedNonLocalStripper`
`AliasedNonLocalStripper` currently strips non-local aliased items that are either non-public or `#[doc(hidden)]`.
The hidden items are subsequently processed by the `strip-hidden` pass. Because they have already been wrapped as stripped items, that pass removes them instead of retaining them as placeholders. As a result, cross-crate aliased types omit `/* private fields */` and `// some variants omitted`.
Handling `#[doc(hidden)]` in `AliasedNonLocalStripper` also means that `--document-hidden-items` cannot display those public fields and variants.
This PR leaves hidden-item handling to `strip-hidden`, while `AliasedNonLocalStripper` continues to unconditionally hide non-public items from external types.
Fixes #144969.
r? @GuillaumeGomez4 files changed
Lines changed: 35 additions & 4 deletions
File tree
- src/librustdoc/passes
- tests/rustdoc-html
- auxiliary
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
| 50 | + | |
| 51 | + | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| 127 | + | |
126 | 128 | | |
0 commit comments