Fix generic code hit by doctests not correctly remapped #122
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cargo-llvm-cov
currently uses--remap-path-prefix
internally (not sure for the reason why?).However that option is not recognized by rustdoc at the moment, which means that generic code that is instantiated in doctests is not counted towards the coverage, as it ends up in a "different" file as far as llvm tools are concerned.
I think in order to fix this, the flag needs to be supported in rustdoc as well, and I am exploring that option right now, so stay tuned.
relates to #2
I opened rust-lang/rust#92648 for the necessary changes in rustdoc, with which I generated the test snapshots in this PR, however I would like to somehow increase the confidence here a bit. Also I have seen that there is some code that does feature detection, and it might be a good idea to do that for this flag as well (and gate the test on the flag being available). Can you maybe point me in the right direction how to best do that?