Closed ehuss closed 2 years ago
The behaviour looks good to me. The only impl concern I have is that it distracts from the actual logic. Maybe move the two new fields into a struct and add named methods for all the cases. Then also move cache
into the struct and predicate
to be a method on the struct.
I'm having a bit of difficulty fully understanding your suggestion. remaining
and estimate
need to be recomputed during each loop, so I'm not sure if they benefit from being in a struct.
Can you say more about what you are thinking?
I pushed a change to move the computation into the closure so that it does not distract from the central algorithm. I also removed the hack adjusting the estimate during an Unknown
scan, since that estimate will jump around or otherwise be wrong since unknown_ranges
is not considered.
Otherwise I'm having a hard time seeing a way to simplify it more.
Ah 🤦 I misread the logic. The new thing is much easier to grok, so mission accomplished!
This adds some reporting to let the user know more about what cargo-bisect-rustc is doing, and provides an estimate of how many more steps it is going to do.
This is not perfect by any means, but seems to provide a decent enough approximation. Some limitations:
print_results
. Ideally that step should be removed (see #85).Fixes #143