-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve -Zhir-stats
#100398
Improve -Zhir-stats
#100398
Conversation
This will be very useful in subsequent commits where I will improve the output.
This commit: - Adds a comment explaining which `visit_*` methods should be implemented. - Adds and removes some `visit_*` methods accordingly, improving coverage, and avoiding some double counting.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, @nnethercote! This looks useful indeed.
I left a comment about a possible simplification below. Otherwise, feel free to r=me.
This tells you which variants of the enums are most common, which is very useful. I've only done it for the AST for now, HIR can be done later.
193d1b3
to
4f8a170
Compare
I made the suggested simplification. @bors r=michaelwoerister |
@bors rollup=always Because these code changes are all behind the |
Rollup of 11 pull requests Successful merges: - rust-lang#92744 (Check if enum from foreign crate has any non exhaustive variants when attempting a cast) - rust-lang#99110 (Determine match_has_guard from candidates instead of looking up thir table again) - rust-lang#100184 (Stabilize ptr_const_cast) - rust-lang#100192 ( Remove duplicated temporaries creating during box derefs elaboration) - rust-lang#100232 (Do not consider method call receiver as an argument in AST.) - rust-lang#100287 (linux: Use `pthread_setname_np` instead of `prctl`) - rust-lang#100351 (Use `&mut Diagnostic` instead of `&mut DiagnosticBuilder` unless needed) - rust-lang#100370 (Remove more Clean trait implementations) - rust-lang#100391 (Improve size assertions) - rust-lang#100398 (Improve `-Zhir-stats`) - rust-lang#100403 (Improve error messages when running rustdoc GUI tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…avidtwco Improve HIR stats rust-lang#100398 improve the AST stats collection done by `-Zhir-stats`. This PR does the same for HIR stats collection. r? `@davidtwco`
…avidtwco Improve HIR stats rust-lang#100398 improve the AST stats collection done by `-Zhir-stats`. This PR does the same for HIR stats collection. r? `@davidtwco`
Add testing, improve coverage, avoid some double counting, and add more detail.
r? @michaelwoerister