Skip to content

Commit 6cd0e7a

Browse files
committed
also clean doc-output for proc macro crates
1 parent beb1caf commit 6cd0e7a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/docbuilder/caching.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ impl ArtifactCache {
2929
/// - ...?
3030
#[instrument(skip(self))]
3131
fn cleanup(&self, target_dir: &Path) -> Result<()> {
32+
// proc-macro crates have a `doc` directory
33+
// directly in the target.
34+
let doc_dir = target_dir.join("doc");
35+
if doc_dir.is_dir() {
36+
debug!(?doc_dir, "cache dir cleanup");
37+
fs::remove_dir_all(doc_dir)?;
38+
}
39+
3240
for item in fs::read_dir(target_dir)? {
3341
// the first level of directories are the targets in most cases,
3442
// delete their doc-directories

0 commit comments

Comments
 (0)