]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: tweak stability summary counting
authorAaron Turon <aturon@mozilla.com>
Sat, 15 Nov 2014 04:54:27 +0000 (20:54 -0800)
committerAaron Turon <aturon@mozilla.com>
Sat, 15 Nov 2014 04:54:27 +0000 (20:54 -0800)
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).

src/librustdoc/stability_summary.rs

index b0e1aeea3a182b84278a39dba63548ca27d865a6..058d8b81f7a7ed83a74ba4e5ef4abb36c43eb1f2 100644 (file)
@@ -146,13 +146,12 @@ fn summarize_item(item: &Item) -> (Counts, Option<ModuleSummary>) {
     // considered to have no children.
     match item.inner {
         // Require explicit `pub` to be visible
-        StructItem(Struct { fields: ref subitems, .. }) |
         ImplItem(Impl { items: ref subitems, trait_: None, .. }) => {
             let subcounts = subitems.iter().filter(|i| visible(*i))
                                            .map(summarize_item)
                                            .map(|s| s.val0())
                                            .fold(Counts::zero(), |acc, x| acc + x);
-            (item_counts + subcounts, None)
+            (subcounts, None)
         }
         // `pub` automatically
         EnumItem(Enum { variants: ref subitems, .. }) => {