Skip to content

Rustdoc keeps around documentation for crates that have been renamed or deleted #78796

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

Closed
RDambrosio016 opened this issue Nov 6, 2020 · 3 comments
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@RDambrosio016
Copy link
Contributor

RDambrosio016 commented Nov 6, 2020

I am working on a decently sized workspace, and i used to have a crate, i have since deleted it, but its documentation stays around because rustdoc does not seem to delete the folders in target/doc if the actual crate has been deleted. Rustdoc should check if a dependency/crate actually exists before using its cache in the documentation process and delete it if it isn't.

Meta

rustc --version --verbose:

rustc 1.48.0-nightly (f68e08933 2020-09-19)
binary: rustc
commit-hash: f68e08933d8f519a9655934fedebbc509661b219
commit-date: 2020-09-19
host: x86_64-pc-windows-msvc
release: 1.48.0-nightly
LLVM version: 11.0

Reproducing

1: cargo init --lib test
2: cargo doc
3: rename the crate to anything else in Cargo.toml
4: cargo doc --open

@RDambrosio016 RDambrosio016 added the C-bug Category: This is a bug. label Nov 6, 2020
@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Nov 6, 2020
@jyn514
Copy link
Member

jyn514 commented Nov 6, 2020

I don't think the workspace is related, you'd have the same issue if you renamed the crate.

@RDambrosio016
Copy link
Contributor Author

Yup, can confirm thats the case, it works with renaming too

@jyn514 jyn514 changed the title Rustdoc keeps around documentation for crates in workspaces despite them being deleted Rustdoc keeps around documentation for crates that have been renamed or deleted Nov 6, 2020
@jyn514
Copy link
Member

jyn514 commented Dec 30, 2020

I'm going to close this in favor of rust-lang/cargo#6783; I don't think rustdoc should be clearing documentation or keep track of state between runs. I'm happy to collaborate with cargo on a fix for this, but I don't think rustdoc can fix it in isolation.

@jyn514 jyn514 closed this as completed Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants