file-level doctests have wrong file/line mapping when module has use-level doctest #79764
Labels
A-doctests
Area: Documentation tests, run by rustdoc
C-bug
Category: This is a bug.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
I have a module in an external file.
When I add doctests to both the
pub mod X;
item, and theX.rs
file, the file-level doctest has the wrong filename/line information.Consider the following example:
Running
cargo test
, I get the following output:The line
test src\lib.rs - mod_with_both_doctests (line 26)
should actually betest src\mod_with_file_doctest.rs - mod_with_file_doctest (line 3)
Looks like that the
line 26
is somehow relative to thepub mod
line.I will look into this and try to get a PR together that fixes this.
The text was updated successfully, but these errors were encountered: