-
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
coverage: Unexpand spans with find_ancestor_inside_same_ctxt
#119336
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@rustbot label +A-code-coverage |
c8c423b
to
9d461d3
Compare
9d461d3
to
0045310
Compare
0045310
to
be6b059
Compare
@rustbot ready |
@bors r+ |
…nkov coverage: Unexpand spans with `find_ancestor_inside_same_ctxt` Back in rust-lang#118525 (comment) it was observed that our `unexpand_into_body_span` now looks very similar to `Span::find_ancestor_inside`. At the time I tried switching over, but doing so resulted in incorrect coverage mappings (or assertion failures), so I left a `FIXME` comment instead. After some investigation, I identified the two problems with my original approach: - I should have been using `find_ancestor_inside_same_ctxt` instead, since we want a span that's inside the body and has the same context as the body. - For async functions, we were actually using the post-expansion body span, which is why we needed to forcibly set the unexpanded span's context to match the body span. For body spans produced by macro-expansion, we already have special-case code to detect this and use the pre-expansion call site as the body span. By making this code also detect async desugaring, I was able to end up with a body span that works properly with `find_ancestor_inside_same_ctxt`, avoiding the need to forcibly change the span context.
…iaskrgr Rollup of 3 pull requests Successful merges: - rust-lang#119336 (coverage: Unexpand spans with `find_ancestor_inside_same_ctxt`) - rust-lang#119349 (refactor(liveness): move walk_expr outside of every match branch) - rust-lang#119359 (Simplify Parser::ident_or_error) r? `@ghost` `@rustbot` modify labels: rollup
☀️ Test successful - checks-actions |
Finished benchmarking commit (8e34642): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 670.933s -> 670.201s (-0.11%) |
Back in #118525 (comment) it was observed that our
unexpand_into_body_span
now looks very similar toSpan::find_ancestor_inside
.At the time I tried switching over, but doing so resulted in incorrect coverage mappings (or assertion failures), so I left a
FIXME
comment instead.After some investigation, I identified the two problems with my original approach:
find_ancestor_inside_same_ctxt
instead, since we want a span that's inside the body and has the same context as the body.find_ancestor_inside_same_ctxt
, avoiding the need to forcibly change the span context.