Skip to content

Commit 6a3c663

Browse files
committed
Change how AssocItem is reported.
Currently it's reported as either `TraitItem` or `ImplItem`. This commit changes it to `AssocItem`, because having the report match the type name is (a) consistent with other types, and (b) the trait/impl split isn't that important here.
1 parent 288b667 commit 6a3c663

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

compiler/rustc_passes/src/hir_stats.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,7 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> {
333333
}
334334

335335
fn visit_assoc_item(&mut self, item: &'v ast::AssocItem, ctxt: ast_visit::AssocCtxt) {
336-
let label = match ctxt {
337-
ast_visit::AssocCtxt::Trait => "TraitItem",
338-
ast_visit::AssocCtxt::Impl => "ImplItem",
339-
};
340-
self.record(label, Id::None, item);
336+
self.record("AssocItem", Id::None, item);
341337
ast_visit::walk_assoc_item(self, item, ctxt);
342338
}
343339

src/test/ui/stats/hir-stats.stderr

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ FnDecl 200 5 40
1717
Variant 240 2 120
1818
Block 288 6 48
1919
Attribute 304 2 152
20-
ImplItem 320 2 160
21-
TraitItem 320 2 160
2220
GenericBound 352 4 88
2321
GenericParam 520 5 104
22+
AssocItem 640 4 160
2423
PathSegment 720 30 24
2524
Expr 832 8 104
2625
Pat 840 7 120
@@ -48,11 +47,10 @@ Param 160 4 40
4847
FnDecl 200 5 40
4948
Variant 240 2 120
5049
Block 288 6 48
51-
ImplItem 320 2 160
52-
TraitItem 320 2 160
5350
GenericBound 352 4 88
5451
GenericParam 520 5 104
5552
Attribute 608 4 152
53+
AssocItem 640 4 160
5654
PathSegment 792 33 24
5755
Pat 840 7 120
5856
Expr 936 9 104

0 commit comments

Comments
 (0)