Skip to content
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

Code compiled with different #[cfg] flags shows up as different instantiations #344

Closed
Ekleog-NEAR opened this issue Jan 25, 2024 · 6 comments · Fixed by #354
Closed

Code compiled with different #[cfg] flags shows up as different instantiations #344

Ekleog-NEAR opened this issue Jan 25, 2024 · 6 comments · Fixed by #354

Comments

@Ekleog-NEAR
Copy link

Initially reported by @Dushistov here:

Oh, that's why not generic functions some times have several instantiation according to html generated by cargo-llvm-cov:

237814209-98e1616c-04a5-4da8-b509-b079f137ff40

The solution might end up being the same as #43

@michaelvlach
Copy link
Contributor

michaelvlach commented Jan 25, 2024

As taiki-e said in the other thread this is a problem of LLVM and not much can be done in cargo-llvm-cov about it. The coverage profiles should be merged but llvm-cov/llvm-profdata would need to do that.

@taiki-e
Copy link
Owner

taiki-e commented Jan 25, 2024

(I'm wondering if this may be another instance of #325.)

@michaelvlach
Copy link
Contributor

(I'm wondering if this may be another instance of #325.)

It almost certainly is. I am also pleasantly surprised that I was wrong and that the issue can be solved with a demangler even with current LLVM implementation! That is great news and could improve teh quality of the coverage reporting.

@taiki-e
Copy link
Owner

taiki-e commented Mar 10, 2024

This probably has been fixed in v0.6.7 (#354). Could you recheck this with v0.6.7?

@michaelvlach
Copy link
Contributor

This probably has been fixed in v0.6.7 (#354). Could you recheck this with v0.6.7?

Thanks for this, I have tried it and I see no missing lines with multiple instantiations anymore as long as the coverage overlaps.

The only remaining issue is await not always mark as executed even though call cahing before/after was executed. But that is a different issue I think not related to demangler or instantiations.

@taiki-e
Copy link
Owner

taiki-e commented Mar 10, 2024

Thanks for confirming!

The only remaining issue is await not always mark as executed even though call cahing before/after was executed. But that is a different issue I think not related to demangler or instantiations.

Yeah, it's different rustc bug: rust-lang/rust#98712

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants