fix(diagnostic): Don't panic on empty spans
### What does this PR try to resolve?
There is another level to this bug where we better point to where the
error occurs, see toml-rs/toml#669.
Fixes#13374
### How should we test and review this PR?
### Additional information
doc: Hide `cargo-fetch` description in offline man page
### What does this PR try to resolve?
Fixes#13232
### How should we test and review this PR?
Suggest review commit by commit.
### Additional information
r? `@weihanglo`
fix(new): Print a 'Creating', rather than 'Created' status
### What does this PR try to resolve?
This has bothered me about `cargo new` and `cargo init` for a while that
the output is read backwards, for example:
```diff
--- i/tests/testsuite/cargo_init/path_contains_separator/stderr.log
+++ w/tests/testsuite/cargo_init/path_contains_separator/stderr.log
`@@` -1,3 +1,3 `@@`
+ Creating binary (application) package
warning: the path `[ROOT]/case/test:ing/.` contains invalid PATH characters (usually `:`, `;`, or `"`)
It is recommended to use a different name to avoid problems.
- Created binary (application) package
```
### How should we test and review this PR?
### Additional information
refactor(shell): Use new fancy anstyle API
### What does this PR try to resolve?
Simplifies working with colored output
### How should we test and review this PR?
### Additional information
CC `@joshtriplett`
This has bothered me about `cargo new` and `cargo init` for a while that
the output is read backwards, for example:
```diff
--- i/tests/testsuite/cargo_init/path_contains_separator/stderr.log
+++ w/tests/testsuite/cargo_init/path_contains_separator/stderr.log
@@ -1,3 +1,3 @@
+ Creating binary (application) package
warning: the path `[ROOT]/case/test:ing/.` contains invalid PATH characters (usually `:`, `;`, or `"`)
It is recommended to use a different name to avoid problems.
- Created binary (application) package
```
refactor: remove unnecessary Option in `Freshness::Dirty`
### What does this PR try to resolve?
This avoids reading and parsing JSON fingerprint files if the detailed
rebuild reason is not requested.
This also encodes `Freshness::Dirty(None)` better with a new variant `DirtyReason::FreshBuild`.
doc: Replace version with `latest` for jobserver link
### What does this PR try to resolve?
I prefer the link with `latest`, it will always jump to the latest version link for crate.
There is a bot called renovate to update the version for crate, So it's ok to use `latest` link.
### How should we test and review this PR?
### Additional information
docs(ref): Try to improve reg auth docs
### What does this PR try to resolve?
My end-goal *was* to discourage the use of `cargo:token` but it immediately failed for me and I need to look into that further.
So this is the smaller steps I made along the way.
### How should we test and review this PR?
### Additional information
For config.md, my expectation is to warn users about `cargo:token` right after the discussion on keeping tokens secret.
I want to find a way to talk about this on the "your first publish" page but that needs to wait until we smooth things out.
fix(config): Deprecate non-extension files
### What does this PR try to resolve?
In #7295 (released in 1.39), we said we'd want to warn on use of
`.cargo/config` after about 6 months. Over 4 years later, we are now
getting that warning.
This is important for addressing user confusion, like in
https://www.reddit.com/r/rust/comments/19fd5q2/cargoconfig/
### How should we test and review this PR?
It'll be important to look at the individual commits as one updates tests from using `.cargo/config` to `.cargo/config.toml` which touches a lot of code.
I added a test for `.cargo/config` in a separate commit so you can see how the output changes.
### Additional information
Discussed on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Deprecating.20credential.20provider.20default.3F)
I thought the recommendation was doing the opposite of what I expected
until I dug further.
While this is covered in the config docs, we should explicitly call it
out.
In #7295 (released in 1.39), we said we'd want to warn on use of
`.cargo/config` after about 6 months. Over 4 years later, we are now
getting that warning.
This is important for addressing user confusion, like in
https://www.reddit.com/r/rust/comments/19fd5q2/cargoconfig/
fix(cli): Improve errors related to cargo script
### What does this PR try to resolve?
Fixes#13332
### How should we test and review this PR?
See tests in last commit to see how this changes error messages.
This is a lot of duplication with minor tweaking that will go away on stabilization
### Additional information