Skip to content

aliases.js and source-files.js duplicate entries. #56921

Closed
@daxpedda

Description

@daxpedda

Problem
Generating new docs with cargo doc without cleaning the files (for example with cargo clean) creates duplicate entries in aliases.js and source-files.js.
The expected behaviour is no duplicate entries.

Steps
I created an example repository here: https://github.com/daxpedda/docs_test.
Going through the commits the bug can be seen easily (#1, #2, #3, #4, #5).

  1. Run cargo doc on a crate with anything to document.
  2. Change some documentation and re-run cargo doc without cleaning the files (for example with cargo clean).
  3. Check the files target/doc/aliases.js and target/doc/source-files.js to see the duplicate entries.

Possible Solution(s)
I didn't look at the code of cargo before, so I have no clue. Obviously a quick hack would be just to overwrite the file and regenerate it every time, I don't think the issue is pressing enough to use a hack though.

Notes
I tested this bug on the nightly toolchain on Windows and Linux.

Metadata

Metadata

Labels

T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions