Skip to content

Improve coverage results on certain derived traits that show two different counters #79626

Description

@richkadel

Related to MIR pass InstrumentCoverage (tracking issue #79121)

The derived traits get coverage, which is great, but some of the traits appear to get two coverage execution counts at different positions:

   4|      2|#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
                      ^0            ^0      ^0 ^0  ^1       ^0 ^0^0
```text

`PartialEq`, `PartialOrd`, and `Ord` (and possibly `Eq`, if the trait name was longer than 2
characters) have counts at their first and last characters.

Why is this? Why does `PartialOrd` have two values (1 and 0)? This must mean we are checking distinct coverages, so maybe we don't want to eliminate one of them. Should we merge them? If merged, do we lose some information?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions