3cf5a6beaa
coverage: Fix an unstable-sort inconsistency in coverage spans This code was calling `sort_unstable_by`, but failed to impose a total order on the initial spans. That resulted in unpredictable handling of closure spans, producing inconsistencies in the coverage maps and in user-visible coverage reports. This PR fixes the problem by always sorting closure spans before otherwise-identical non-closure spans, and also switches to a stable sort in case the ordering is still not total. --- In addition to the fix itself, this PR also contains a cleanup to the comparison function that I was working on when I discovered the bug.