-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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: Remove debug code from the instrumentor #115962
Conversation
The main things being removed here are:
|
All of that sounds useful in the abstract, but it's all so heavily tied to the current instrumentor implementation that it is easily broken by any non-trivial change to the instrumentor, often in ways that are difficult or impossible to fix without major changes to the debug code itself. |
Ironically, much of the information being tracked by the debug code would be much easier to extract directly from the main data structures, if only we could make changes to those data structures that are being prevented by the existence of the debug code. |
This does not remove the |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
r? @oli-obk |
@bors r+ rollup |
…llaumeGomez Rollup of 5 pull requests Successful merges: - rust-lang#115566 (clean up unneeded `ToPredicate` impls) - rust-lang#115962 (coverage: Remove debug code from the instrumentor) - rust-lang#115988 (rustdoc: add test cases, and fix, search tabs layout jank) - rust-lang#115991 (Ensure `build/tmp` exists in `rustdoc_themes::get_themes`) - rust-lang#115997 (RELEASES.md: Add missing patch releases) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#115962 - Zalathar:debug, r=oli-obk coverage: Remove debug code from the instrumentor The coverage instrumentor has an entire module full of complex code that is only used for debugging. And as I continue to work on coverage, I keep finding that this debug code is constantly causing more trouble than it's worth. It's deeply entangled with current implementation details, such that making any non-trivial change to the instrumentor usually requires major changes to the debug code. And so far I have personally not found any of this debug code to be *useful*. In light of that situation, I'd like to try just ripping all of it out. If I spend any more time dealing with coverage debug code, I want it to be because I'm writing new and useful tools, not dutifully maintaining a boat-anchor that quite plausibly isn't being used by anyone at all. --- r? `@ghost` `@rustbot` label +A-code-coverage --- [Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Removing.20debug.20code.20from.20the.20coverage.20instrumentor)
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
This enum was mainly needed to track the precise origin of a span in MIR, for debug printing purposes. Since the old debug code was removed in rust-lang#115962, we can replace it with just the span itself.
Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic when they detect a bug.
Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic when they detect a bug.
Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic when they detect a bug.
Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic when they detect a bug.
Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic when they detect a bug.
Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic when they detect a bug.
Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic when they detect a bug.
coverage: Replace impossible `coverage::Error` with assertions Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic immediately when they detect a bug.
coverage: Replace impossible `coverage::Error` with assertions Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic immediately when they detect a bug.
Rollup merge of rust-lang#117421 - Zalathar:error, r=oli-obk,Swatinem coverage: Replace impossible `coverage::Error` with assertions Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic immediately when they detect a bug.
Historically, these errors existed so that the coverage debug code could dump additional information before reporting a compiler bug. That debug code was removed by rust-lang#115962, so we can now simplify these methods by making them panic when they detect a bug.
The coverage instrumentor has an entire module full of complex code that is only used for debugging.
And as I continue to work on coverage, I keep finding that this debug code is constantly causing more trouble than it's worth. It's deeply entangled with current implementation details, such that making any non-trivial change to the instrumentor usually requires major changes to the debug code. And so far I have personally not found any of this debug code to be useful.
In light of that situation, I'd like to try just ripping all of it out. If I spend any more time dealing with coverage debug code, I want it to be because I'm writing new and useful tools, not dutifully maintaining a boat-anchor that quite plausibly isn't being used by anyone at all.
r? @ghost
@rustbot label +A-code-coverage
Zulip thread