chore(ci): Ignore patch version in MSRV
1. Its extra churn to be forced to update patch releases
2. #12654 adds `cargo hack` which doesn't handle MSRV patch versions well
fix: use channel-specific link for registry auth error
The current error message for attempting to use a private registry without a credential provider will be a dead link until it's stabilized in 1.74. This makes the URL dependent on the channel.
r? `@ehuss`
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.
The previous status line was a little awkward in the way it combined
both counts. I don't think showing the directories is particularly
interesting, so they are only displayed when no files are deleted.
This refactors some of the `cargo clean` code to wrap the "cleaning"
operation in a `CleanContext` so that the context can be passed to other
parts of cargo which can perform their own cleaning operations.
There are some minor changes in the error messages to prepare for
cleaning operations that aren't directly related to the build directory.
Shortest path
### What does this PR try to resolve?
Currently error messages from the resolver are based a random path from a package that couldn't be resolved back to the root package. It was pointed out to me that the shortest route is likely to be more useful so the switches to using breadth first search to pick the path. There is also one re-factor to use let-else that I spotted while doing this work.
### How should we test and review this PR?
The shortest path is is a random path, so this is not technically a behavioral change. As such the tests still pass is good evidence for being reasonable.
SemVer: Update documentation about removing optional dependencies
This updates the documentation cautioning against removing optional dependencies with more up-to-date information about using the `dep:` syntax in the features table. This documentation was written before `dep:`, and I just forgot to update these docs when it was stabilized.
`cargo` waits for the package to appear in the index by default these days, so these obsolete extra `sleep()` calls are just making the publish process slower now without any advantages.