Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #12638 - ehuss:clean-updates, r=epage
Add some enhancements to `cargo clean` ### What does this PR try to resolve? This adds some enhancements to `cargo clean` that fell out as a result of some refactorings in #12634 for supporting an interface for cleaning from other places in cargo, and these were relatively easy to add and assist with testing in #12634. The changes are: - Introduce some refactoring to offer a cleaning interface that can be used elsewhere in cargo. - Adds a `--dry-run` CLI option which will print what `cargo clean` will delete without deleting it. **NOTE** This PR makes the flag insta-stable. I don't figure there is too much that can be learned about it keeping it unstable, though we could change that. #12634 has this flag gated with `-Zgc`. - Adds a summary line at the end of the `cargo clean` operation that indicates how much was deleted. ### How should we test and review this PR? Note that this PR also includes the changes from #12635 and #12637. Those commits can be dropped if those PRs are merged. For the most part, this involves wrapping the cleaning operations in a `CleanContext` which provides an interface for performing cleaning operations. The dry run is just a flag that is checked at the deletion points. The summary data is also collected at those same points.
- Loading branch information