Skip to content

Commit 60741e0

Browse files
committed
rustdoc: tweak stability summary counting
This commit slightly tweaks the counting of impl blocks and structs for the stability summary (so that the block itself isn't counted for inherent impls, and the fields aren't counted for structs).
1 parent 4caffa8 commit 60741e0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/librustdoc/stability_summary.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,12 @@ fn summarize_item(item: &Item) -> (Counts, Option<ModuleSummary>) {
146146
// considered to have no children.
147147
match item.inner {
148148
// Require explicit `pub` to be visible
149-
StructItem(Struct { fields: ref subitems, .. }) |
150149
ImplItem(Impl { items: ref subitems, trait_: None, .. }) => {
151150
let subcounts = subitems.iter().filter(|i| visible(*i))
152151
.map(summarize_item)
153152
.map(|s| s.val0())
154153
.fold(Counts::zero(), |acc, x| acc + x);
155-
(item_counts + subcounts, None)
154+
(subcounts, None)
156155
}
157156
// `pub` automatically
158157
EnumItem(Enum { variants: ref subitems, .. }) => {

0 commit comments

Comments
 (0)