tarpaulin icon indicating copy to clipboard operation
tarpaulin copied to clipboard

Partial struct initialization included in a coverage report

Open zhiburt opened this issue 2 years ago • 1 comments

Describe the bug

Hi there,

Sometimes a structure initialization included in a coverage report but only partially. Whereas sometimes it's not included at all.

Screenshot_2022-05-14_14-10-02

Screenshot_2022-05-14_14-04-10

I did tried to reproduce it by a minimal example but didn't managed easily.

Sorry if it's a duplicate.

Expected behavior

I suppose the report must be consistent in approach?

zhiburt avatar May 14 '22 11:05 zhiburt

The constants like "" end up being optimised out a lot of the time and don't result in instructions I can catch in the coverage instrumentation. I believe now it should just ignore constants and just simple variable assigns but not ignore function calls or more complicated expressions.

Ah just noticed the second one is a generic function. The stuff to ensure unused generic functions and methods are included in the report is over eagerly adding back in the lines :eyes:. I'll look into that at some point before the next release

xd009642 avatar May 14 '22 16:05 xd009642