19570 Commits

Author SHA1 Message Date
Weihang Lo
eddd7ec6f7
Remove the original changelog (#15123)
This removes the original changelog now that it is located in the cargo
book.

This places a notice in the original location that it has moved to a new
place. There are a few other alternatives we could consider:
* Keep the headings but replace the content with a link. This would make
it a little easier for someone to jump to the exact position in the new
page. However, it looks a little messy. Each section could be something
like:

> This content has moved to
[CHANGELOG.md#186-2025-04-03](https://doc.rust-lang.org/cargo/nightly/CHANGELOG.md#186-2025-04-03)

* Keep the content, with a notice at the top that the page is no longer
being updated. I was a little uncomfortable with this, since I wasn't
sure people would see the notice, it duplicates some content, and still
leaves the potential problems of GitHub not rendering the page. If we
cut some content, it ensures the page still renders reliably.
* As a variant, we could delete the content but keep the last 1 or 2
releases since those are probably what people will be looking for.

Opening as draft until https://github.com/rust-lang/cargo/pull/15119 is
published on nightly.
2025-02-03 22:13:23 +00:00
Ed Page
990c7f41e0
chore(deps): update rust crate gix to 0.70.0 (#15128)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [gix](https://redirect.github.com/GitoxideLabs/gitoxide) |
workspace.dependencies | minor | `0.69.1` -> `0.70.0` |

---

### Release Notes

<details>
<summary>GitoxideLabs/gitoxide (gix)</summary>

###
[`v0.70.0`](https://redirect.github.com/GitoxideLabs/gitoxide/releases/tag/gix-v0.70.0):
gix v0.70.0

[Compare
Source](https://redirect.github.com/GitoxideLabs/gitoxide/compare/gix-v0.69.1...gix-v0.70.0)

##### Chore

- <csr-id-17835bccb066bbc47cc137e8ec5d9fe7d5665af0/> bump `rust-version`
to 1.70
That way clippy will allow to use the fantastic `Option::is_some_and()`
    and friends.

##### New Features

- add
`Repository::upstream_branch_and_remote_name_for_tracking_branch()`
    It's a way to learn about the Remote and upstream branch which would
    match the given local tracking branch.
-   more often check for interrupts in status iterator
- add `tree::Editor|editor::Cursor::get()` to see if an entry is loaded
at path.
This can be useful to get a feeling for how far the tree was already
made available,
    even though it won't reveal if an entry was edited.
-   `Repository::is_dirty()` now also checks for tree/index changes.
    This copmpletes the `is_dirty()` implementation.
- `Repository::tree_index_status()` to see the changes between a tree
and an index.
It also respects `status.rename` and `status.renameLimit` to configure
rename tracking.
-   add `Tree::depthfirst()` with a delegate.
    This allows a depth-first traversal with a delegate.
-   Add `blame` plumbing crate to the top-level.
    For now, it doesn't come with a simplified `gix` API though.

##### Bug Fixes

- `Repository::status()` detects files added to the index in an unborn
repository.
    Previously it wouldn't show them.
-   `Respository::status()` iterator won't fail in unborn directories.
-   worktrees of submodules now know their correct worktree
Previously they would use a very incorrect worktree which would cause
    the status to be calculated very wrongly.
- status-iterator won't swallow legitimate modification during
'racy-git'.
When a modification is marked as being racy, then previously the
iterator would have
kept the whole modification even though it should just have tracked the
single change.

    This made the legitimate modification disappear.
-   `write_blob_stream()` does not need `Seek` trait anymore.
Internally, it has to turn it into a buffer so it's not needed anymore.
It also counteracts the idea of using a stream with arbitrarily big
files.
-   `Submodule::status()` now konws about tree-index changes as well.
    This completes the status implementation.
-   remove unused fetch-error variants
Note that it's a breaking change, but it's on top of a previous breaking
change
    so folks would already have to update explicitly.

##### Other

- <csr-id-9db21601b61601c01cd2419543e2c461a7dd568d/> make really clear
that `Repository::worktrees()` lists linked worktrees.
    Excluding the main worktree which isn't always present.

##### New Features (BREAKING)

-   add `status::Platform::into_iter()` for obtaining a complete status.
    Note that it is still possible to disable the head-index status.

    Types moved around, effectivey removing the `iter::` module for most
    more general types, i.e. those that are quite genericlally useful in
    a status.

##### Bug Fixes (BREAKING)

-   all `config::Snapshot` access now uses the new `Key` trait.
That way one can officially use "section.name" strings or
`&Section::NAME`.

##### Commit Statistics

- 40 commits contributed to the release over the course of 27 calendar
days.
-   27 days passed between releases.
- 18 commits were understood as
[conventional](https://www.conventionalcommits.org).
- 1 unique issue was worked on:
[#&#8203;1770](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1770)

##### Thanks Clippy

[Clippy](https://redirect.github.com/rust-lang/rust-clippy) helped 1
time to make code idiomatic.

##### Commit Details

<csr-read-only-do-not-edit/>

<details><summary>view details</summary>

-
**[#&#8203;1770](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1770)**
- `Repository::status()` detects files added to the index in an unborn
repository.
([`cd8fabf`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/cd8fabf))
-   **Uncategorized**
- Update all changelogs prior to release
([`1f6390c`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/1f6390c))
- Merge pull request
[#&#8203;1774](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1774)
from EliahKagan/complex-graph-no-baseline-next
([`90e08f1`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/90e08f1))
- Use parse_spec_no_baseline with :/ for all 2.47.\* on CI
([`fe33fa7`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/fe33fa7))
- Merge pull request
[#&#8203;1772](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1772)
from GitoxideLabs/improvements
([`4c8200f`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/4c8200f))
- Merge pull request
[#&#8203;1769](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1769)
from GitoxideLabs/improvements
([`47e44c5`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/47e44c5))
- `Respository::status()` iterator won't fail in unborn directories.
([`84019cb`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/84019cb))
- Merge pull request
[#&#8203;1768](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1768)
from GitoxideLabs/improvements
([`34fa6bb`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/34fa6bb))
- Adapt to changes in `gix-status`
([`25d480c`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/25d480c))
- Merge pull request
[#&#8203;1750](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1750)
from GitoxideLabs/odb-issue
([`e4fb21e`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/e4fb21e))
- Reproduce issue with 'too many packs' for slotmap
([`dbf079f`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/dbf079f))
- Merge pull request
[#&#8203;1763](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1763)
from GitoxideLabs/better-refspec-primitives
([`af8f201`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/af8f201))
- Add
`Repository::upstream_branch_and_remote_name_for_tracking_branch()`
([`da0e1c7`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/da0e1c7))
- Adapt to changes in `gix-refspec`
([`6d7dd9b`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/6d7dd9b))
- Merge pull request
[#&#8203;1762](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1762)
from GitoxideLabs/fix-1759
([`7ec21bb`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/7ec21bb))
- Bump `rust-version` to 1.70
([`17835bc`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/17835bc))
- Make really clear that `Repository::worktrees()` lists linked
worktrees.
([`9db2160`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/9db2160))
- Worktrees of submodules now know their correct worktree
([`bc02284`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/bc02284))
- Merge pull request
[#&#8203;1752](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1752)
from GitoxideLabs/git-shell
([`1ca480a`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/1ca480a))
- Thanks clippy
([`9193b05`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/9193b05))
- Merge pull request
[#&#8203;1749](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1749)
from GitoxideLabs/status
([`8d84818`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/8d84818))
- More often check for interrupts in status iterator
([`5b6e5c8`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/5b6e5c8))
- Merge pull request
[#&#8203;1746](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1746)
from GitoxideLabs/status
([`af704f5`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/af704f5))
- Add `tree::Editor|editor::Cursor::get()` to see if an entry is loaded
at path.
([`3b53982`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/3b53982))
- Status-iterator won't swallow legitimate modification during
'racy-git'.
([`3bbd1f7`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/3bbd1f7))
- `write_blob_stream()` does not need `Seek` trait anymore.
([`a03bde5`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/a03bde5))
- Merge pull request
[#&#8203;1410](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1410)
from GitoxideLabs/status
([`0ab4f64`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/0ab4f64))
- `Submodule::status()` now konws about tree-index changes as well.
([`a987e68`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/a987e68))
- Add `status::Platform::into_iter()` for obtaining a complete status.
([`801689b`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/801689b))
- All `config::Snapshot` access now uses the new `Key` trait.
([`a6f397f`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/a6f397f))
- `Repository::is_dirty()` now also checks for tree/index changes.
([`8ae9e57`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/8ae9e57))
- `Repository::tree_index_status()` to see the changes between a tree
and an index.
([`83f3d93`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/83f3d93))
- Add `Tree::depthfirst()` with a delegate.
([`592e250`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/592e250))
- Adapt to changes in `gix-traverse`
([`1de4e70`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/1de4e70))
- Merge pull request
[#&#8203;1453](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1453)
from cruessler/gix-blame
([`6ed9976`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/6ed9976))
- Add `blame` plumbing crate to the top-level.
([`25efbfb`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/25efbfb))
- Release gix v0.69.1
([`7659a65`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/7659a65))
- Merge pull request
[#&#8203;1740](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1740)
from GitoxideLabs/cargo-improvements
([`3fb0c18`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/3fb0c18))
- Remove unused fetch-error variants
([`51a4301`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/51a4301))
- Merge pull request
[#&#8203;1739](https://redirect.github.com/GitoxideLabs/gitoxide/issues/1739)
from GitoxideLabs/new-release
([`d22937f`](https://redirect.github.com/GitoxideLabs/gitoxide/commit/d22937f))

</details>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on the first day of the
month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/rust-lang/cargo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNDUuMCIsInVwZGF0ZWRJblZlciI6IjM5LjE0NS4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
2025-02-03 21:30:17 +00:00
Ed Page
08055a443c refactor: Resolve deprecations 2025-02-03 15:07:36 -06:00
Eric Huss
e82878c66c
allow windows reserved names in CI (#15135)
<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing
issue.

### How should we test and review this PR?

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->

We are progressively moving the windows CI from windows 2022 to windows
2025 because we found windows 2025 more stable.

In https://github.com/rust-lang/rust/pull/136478 a cargo test failed and
this might solve the issue. See
[this](https://github.com/rust-lang/rust/pull/136478#issuecomment-2631307932)
comment. What do you think?

If you have a better way of solving this, let me know 👍
2025-02-03 20:54:43 +00:00
Ed Page
5408bd9f52 fix: Update generic 'did you meann' reports to not say that 2025-02-03 13:07:47 -06:00
Ed Page
c2023a14e1 fix(cli): Don't use 'did you mean' on unknown command errors 2025-02-03 12:58:53 -06:00
Ed Page
fefd9fbb32
removed a word that was repeated (#15136)
Hey there,

While reading the documentation, I noticed that the word 'considered'
was written two times. So I removed one.

Thank you!

<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing
issue.

### How should we test and review this PR?

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->
2025-02-03 18:46:29 +00:00
Ed Page
e090b6fcd6 fix(spec): Don't use 'did you mean' for PackageIdSpec errors 2025-02-03 12:26:47 -06:00
Bilal Khan
ca1d8f640e removed a word that was repeated 2025-02-03 23:13:57 +05:00
MarcoIeni
54f97e28fd
allow windows reserved names in CI 2025-02-03 17:51:51 +01:00
Ed Page
759178e42b fix(cli): Don't use 'did you mean' for +toolchain errors 2025-02-03 10:37:53 -06:00
Scott Schafer
0e3d73849a
Revert "Conditionally mark the test cfg as a well known cfg (#15007)" (#15132)
This reverts #15007,
as it causes confusions and needs more time to figure out a proper
solution.

See

* #15131
*
<https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/.60test.60.20well.20known.20cfg.20error>
* <https://github.com/rust-lang/cargo/pull/15007#discussion_r1938322212>
2025-02-01 20:14:40 +00:00
Weihang Lo
e79dae5bec
Revert "Conditionally mark the test cfg as a well known cfg (#15007)"
This reverts commit 26ce02737ae4b74a008355d302ef283375032cf6, reversing
changes made to 730d9977f1d0b6967f473d93f4034c6580d33a35.
2025-02-01 14:14:05 -05:00
renovate[bot]
e9132fb248 chore(deps): update rust crate rand to 0.9.0 2025-02-01 00:25:29 +00:00
renovate[bot]
4f60d690bc
chore(deps): update rust crate gix to 0.70.0 2025-02-01 00:25:03 +00:00
Weihang Lo
776129a2b9
Don't suggest cargo login when using incompatible credental providers (#15124)
Authentication errors shouldn't unconditionally recommend running `cargo
login`, because alternative registries configured to use custom
credential providers won't use the token obtained by `cargo login`.
2025-01-30 15:34:14 +00:00
Kornel
aa6c48ffea
Don't suggest cargo login for other credential providers 2025-01-30 13:39:10 +00:00
Kornel
8f12fe581a
Test login error with non-token provider 2025-01-30 13:38:58 +00:00
Eric Huss
daf3b16816 Remove the original changelog
The changelog is now located in the cargo book.
2025-01-29 13:28:57 -08:00
Scott Schafer
51346addcc
chore: Update clap_complete (#15121)
### What does this PR try to resolve?

This includes `CARGO_COMPLETE=` and `CARGO_COMPLETE=0` to disable
completions. I'm wanting access to this for my bash script that runs
Cargo out of the `target/debug` without the outer cargo doing the
completions

### How should we test and review this PR?

### Additional information
2025-01-29 16:28:06 +00:00
Ed Page
7ab469d339 chore: Update clap_complete 2025-01-29 09:43:25 -06:00
Weihang Lo
5a882c1f23
Move the changelog to the cargo book (#15119)
This moves cargo's changelog to the cargo book. We're bumping into
rendering limits on GitHub's side, so we're moving the changelog to the
cargo book where it can be statically served under our control.

This PR is structured in such a way that the original CHANGELOG.md file
is kept in place (and history is preserved in the new copy). The intent
is to wait until this PR makes it to the nightly channel, and then open
a new PR that will delete the original. That will look something like
5ce7947693.

This makes use of a new mdbook feature in order to exclude the changelog
chapter from the search index. It completely swamps the search results,
so I think it is best to just exclude it.

We'll need to coordinate with the release team so that future release
notes link directly to the cargo book instead of GitHub.
2025-01-29 15:22:50 +00:00
Eric Huss
790c776f1a Fix broken markdown syntax 2025-01-28 20:24:17 -08:00
Eric Huss
2e65c8913e Keeping changelog to retain history
This is so that we temporarily keep a copy of the CHANGELOG in
the original location until the website is updated.
2025-01-28 18:55:13 -08:00
Eric Huss
1ed329b186 Merging changlog to preserve history 2025-01-28 18:53:52 -08:00
Eric Huss
767445df48 Backing up changelog 2025-01-28 18:53:21 -08:00
Eric Huss
19b5e2356c Move changelog to the cargo book
Due to rendering limits with GitHub's markdown renderer, we're moving
the changelog to the cargo book where it can be statically served under
our control.
2025-01-28 18:52:33 -08:00
Ed Page
26ce02737a
Conditionally mark the test cfg as a well known cfg (#15007)
### What does this PR try to resolve?

This PR conditionally mark the `test` cfg as a well known cfg depending
on the target unit "test" field (ie `lib.test = false`, `[[bin]] test =
false` and others).

This is related to https://github.com/rust-lang/rust/issues/117778 and
https://users.rust-lang.org/t/cargo-what-is-the-purpose-of-lib-test-false/102361.

When defining `lib.test = false` (and others), any use of `cfg(test)`
will trigger the `unexpected_cfgs` lint.
```toml
[lib]
test = false  # will now warn on cfg(test)
```

### How should we test and review this PR?

Best reviewed commit by commit. Second commit removes the `test` cfg
from the `--check-cfg` args.

### Additional information

T-compiler
[MCP#785](https://github.com/rust-lang/compiler-team/issues/785) and
https://github.com/rust-lang/cargo/pull/14963 were of preparatory work.

r? @epage
2025-01-28 19:55:00 +00:00
Eric Huss
730d9977f1
fix broken links in the Cargo book (#15109)
This PR closes #15102. I fixed broken links in the SUMMARY.md and
guide/index.md of the Cargo book.
2025-01-28 03:44:32 +00:00
Eric Huss
ba4d7869a6
Fix a typo and touch up documentation (#15108)
This PR closes #15101. I fixed a typo and touched up some sentences.
2025-01-28 03:43:31 +00:00
Eric Huss
f71f565bbd
Fix shared_std_dependency_rebuild running on Windows (#15111)
This fixes the `standard_lib::shared_std_dependency_rebuild` test while
running on Windows. On my system, `CARGO_MANIFEST_DIR` is a normal
windows-style path (`D:\rust\cargo`) with backslashes. That is not valid
TOML syntax. I don't know why this doesn't fail on CI (maybe CI sets a
unix-style current dir?).
2025-01-28 03:39:35 +00:00
Eric Huss
f62525d31b
Fix warnings on Windows (#15112)
This fixes some warnings that show up on Windows:

```
warning: unused variable: `path`
    --> tests\testsuite\registry.rs:3146:24
     |
3146 |     fn set_permissions(path: &Path, permissions: u32) {
     |                        ^^^^ help: if this is intentional, prefix it with an underscore: `_path`
     |
     = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `permissions`
    --> tests\testsuite\registry.rs:3146:37
     |
3146 |     fn set_permissions(path: &Path, permissions: u32) {
     |                                     ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_permissions`
```
2025-01-28 03:34:33 +00:00
yegeunyang
a9eec5cbb5 Fix a typo and touch up documentation 2025-01-27 19:14:24 -08:00
Eric Huss
7908e4210b Sync reference contents with SUMMARY.md 2025-01-27 19:12:01 -08:00
yegeunyang
8cd5cdf91e fix broken links in the Cargo book 2025-01-27 19:10:04 -08:00
Eric Huss
caff80d7f5 Fix shared_std_dependency_rebuild running on Windows 2025-01-27 19:06:22 -08:00
Eric Huss
e722344620 Fix warnings on Windows 2025-01-27 19:05:28 -08:00
Weihang Lo
9eda47ee04
fix(login): Deprecate CLI token (#15057)
### What does this PR try to resolve?

This came up in #13623 to avoid putting tokens into shell history.

### How should we test and review this PR?

The exact approach to deprecation can vary
- Include `<token>` in at least some docs for discovery (most likely the
man page)
- Don't warn yet

etc

I also suspect we could reorganize `cargo help login` but wanted to
decouple that from this change.

### Additional information
2025-01-28 02:53:08 +00:00
Eric Huss
fd4f492125
Update tests to fix nightly errors (#15110)
There were some changes in the latest nightly which is breaking some
tests:

* https://github.com/rust-lang/rust/pull/133154 updated the wording of a
message. I adjusted the test to be less sensitive to the exact wording.
* https://github.com/rust-lang/rust/pull/119286 added the
`linker-messages` lint which shows the output from the linker. Some of
our tests were passing dummy flags to the linker, which it was
complaining about. This updates it so that it uses real directories.
* This also fixes an incidental issue, where
`build_script_needed_for_host_and_target` was not testing for the
correct command-line flags. These got lost in
https://github.com/rust-lang/cargo/pull/14132.
2025-01-28 02:33:18 +00:00
Eric Huss
c35cb56d32 Update tests to deal with linker warnings
Nightly recently introduced the `linker-messages` lint which prints any
messages from linkers. These tests were triggering that lint because
they were passing missing directories to the linker. This fixes it by
creating empty directories to pass to the linker.

Note that this lint will be downgraded soon via
https://github.com/rust-lang/rust/pull/136098, but it seemed worthwhile
to fix the underlying problem.

This also fixes a problem where build_script_needed_for_host_and_target
was not testing for the correct command-line flags. These got lost
in https://github.com/rust-lang/cargo/pull/14132.
2025-01-26 13:25:17 -08:00
Eric Huss
2c6338b856 Update test message for E0433
The text of the message was changed in https://github.com/rust-lang/rust/pull/133154
2025-01-26 12:43:34 -08:00
Weihang Lo
e63457a4ce
Fix comment on Ord for SourceId (#15103)
### What does this PR try to resolve?

In PR #14980, the Ord impl for SourceId was changed, but the comment
wasn’t updated. So it is now incorrect.

This PR updates the comment to match the implementation.

### How should we test and review this PR?

Read the Ord for SourceId code and make sure the updated comment
describes what it does.

### Additional information

None
2025-01-25 20:35:24 +00:00
teor
6e46d4c862
Fix comment on Ord for SourceId 2025-01-26 05:58:00 +10:00
Weihang Lo
cecde95c11
Remove unused -C link-arg=-fuse-ld=lld (#15097)
That's a gcc flag. lld is a linker, not a C compiler, and doesn't accept
a `use-ld` flag. `-C linker=rust-lld` (which is already present in the
test) is enough.

This fixes the following warning found in rust-lang/rust#119286:
```
---- expected: tests\testsuite\freshness.rs:2822:27
++++ actual:   stderr
   1    1 | [FRESH] foo v0.1.0 ([ROOT]/foo)
        2 + [WARNING] linker stderr: rust-lld: ignoring unknown argument '-fuse-ld=lld'␍
        3 +   |
        4 +   = [NOTE] `#[warn(linker_messages)]` on by default
        5 +
        6 + [WARNING] `foo` (lib) generated 1 warning
   2    7 | [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
```

<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing
issue.

### How should we test and review this PR?

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->
2025-01-24 17:15:24 +00:00
jyn
00d4e3d1ad Remove unused -C link-arg=-fuse-ld=lld
That's a gcc flag. lld is a linker, not a C compiler, and doesn't accept
a `use-ld` flag. `-C linker` (which is already present in the test) is
enough.

This fixes the following warning found in rust-lang/rust#119286:
```
---- expected: tests\testsuite\freshness.rs:2822:27
++++ actual:   stderr
   1    1 | [FRESH] foo v0.1.0 ([ROOT]/foo)
        2 + [WARNING] linker stderr: rust-lld: ignoring unknown argument '-fuse-ld=lld'␍
        3 +   |
        4 +   = [NOTE] `#[warn(linker_messages)]` on by default
        5 +
        6 + [WARNING] `foo` (lib) generated 1 warning
   2    7 | [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
```
2025-01-24 11:44:49 -05:00
Ed Page
86e83e8b38
Remove unsafe by using LazyLock (#15096)
There isn't a good reason to use unsafe code here, and as far as I know
`LazyLock` meets the MSRV of 1.82 as it was added in 1.80. Should have
no change to behavior.
2025-01-24 15:46:49 +00:00
anteater
8da5ba4f1c
Remove unsafe by using LazyLock 2025-01-24 15:14:15 +00:00
Ed Page
91d8140d66
Print globs when workspace members can't be found (#15093)
Cargo expands globs when loading workspace members. If the glob happens
to match some non-crate directory, it causes an error that may be tricky
to understand, because it makes Cargo complain that it failed to read a
`Cargo.toml` from a specific directory, but that directory name won't be
listed explicitly anywhere in `Cargo.toml`, so it may seem that Cargo is
trying to read some made-up phantom manifest.

I've made the error messages mention which glob has been used to select
the missing workspace member.
2025-01-23 21:13:33 +00:00
Kornel
9b3146432d Print globs when workspace members can't be found 2025-01-23 20:43:12 +00:00
Weihang Lo
53a2fdf0c0
Make --allow-dirty imply --allow-staged (#15013)
Staged changes don't really need protecting, and `--allow-dirty` is
stronger than `--allow-staged`, so it can imply `--allow-staged` to make
usage of `cargo fix` less verbose.

Closes #14176
2025-01-21 21:09:16 +00:00