Skip to content

cargo clean -p does not clean documentation #8790

Open
@jyn514

Description

@jyn514

Problem

cargo clean -p package should remove target/doc/package, but does not.

Steps

$ cargo new test-doc
     Created binary (application) `test-doc` package
$ cd test-doc
Cargo.toml  src
$ cargo doc
 Documenting test-doc v0.1.0 (/home/joshua/src/rust/test-doc)
    Finished dev [unoptimized + debuginfo] target(s) in 0.70s
$ ls target/doc
ayu.css                main.js                      source-files.js
brush.svg              normalize.css                source-script.js
COPYRIGHT.txt          noscript.css                 SourceSerifPro-Bold.ttf.woff
dark.css               rustdoc.css                  SourceSerifPro-It.ttf.woff
down-arrow.svg         rust-logo.png                SourceSerifPro-LICENSE.md
favicon.ico            search-index.js              SourceSerifPro-Regular.ttf.woff
FiraSans-LICENSE.txt   settings.css                 src
FiraSans-Medium.woff   settings.html                storage.js
FiraSans-Regular.woff  settings.js                  test_doc
LICENSE-APACHE.txt     SourceCodePro-LICENSE.txt    theme.js
LICENSE-MIT.txt        SourceCodePro-Regular.woff   wheel.svg
light.css              SourceCodePro-Semibold.woff
$ cargo clean -p test-doc
$ ls target/doc
ayu.css                main.js                      source-files.js
brush.svg              normalize.css                source-script.js
COPYRIGHT.txt          noscript.css                 SourceSerifPro-Bold.ttf.woff
dark.css               rustdoc.css                  SourceSerifPro-It.ttf.woff
down-arrow.svg         rust-logo.png                SourceSerifPro-LICENSE.md
favicon.ico            search-index.js              SourceSerifPro-Regular.ttf.woff
FiraSans-LICENSE.txt   settings.css                 src
FiraSans-Medium.woff   settings.html                storage.js
FiraSans-Regular.woff  settings.js                  test_doc
LICENSE-APACHE.txt     SourceCodePro-LICENSE.txt    theme.js
LICENSE-MIT.txt        SourceCodePro-Regular.woff   wheel.svg
light.css              SourceCodePro-Semibold.woff
$ cargo clean
$ ls target/doc
ls: cannot access 'target/doc': No such file or directory

Possible Solution(s)

Notes

Output of cargo version:

cargo 1.47.0 (f3c7e06 2020-08-28), but the bug is also present in cargo 1.48.0-nightly (9d1a4863a 2020-10-05).

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugCommand-cleanS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions