11409 Commits

Author SHA1 Message Date
Ed Page
2fdb7100cc Remove TOML incompatibility hacks
- `set_require_newline_after_table` was added in #2680 back in 2016
- `set_allow_duplicate_after_longer_table` was added in #6761 in 2019

Several years later, this PR is turning these warnings into errors.

The function and documentation was kept so we can add additional hacks
in the future, like if we switch TOML parsers.
2021-09-21 14:48:18 -05:00
bors
53471b7502 Auto merge of #9914 - alexcrichton:bump-curl, r=ehuss
Bump Cargo's curl requirement to 7.79.0

Brings in the latest release of `curl`
2021-09-15 15:11:44 +00:00
Alex Crichton
3093df485c Bump Cargo's curl requirement to 7.79.0
Brings in the latest release of `curl`
2021-09-15 07:39:25 -07:00
bors
f69305e005 Auto merge of #9911 - rust-lang:revert-9686-rustin-patch-error, r=alexcrichton
Revert "When a dependency does not have a version, git or path, fails directly"

Reverts rust-lang/cargo#9686

We discussed, and felt like this change wasn't all that important, and a few people have mentioned that it caused problems for them.

Closes #9885
2021-09-14 20:20:30 +00:00
Eric Huss
d4e504ca85
Revert "When a dependency does not have a version, git or path, fails directly" 2021-09-14 13:04:03 -07:00
bors
72ef2bd8cc Auto merge of #9904 - ehuss:contrib-debug-test, r=alexcrichton
Add some contributor docs for debugging testsuite tests.

This adds some suggestions on how to debug testsuite tests.

Closes #9757
2021-09-13 19:09:16 +00:00
bors
ed8590e8c0 Auto merge of #9903 - jyn514:rustdoc-warnings, r=alexcrichton
Fix warnings when documenting with `--document-private-items`

- Use hyperlinks for URLs
- Fix broken intra-doc links

This doesn't fix the following warning, since I wasn't sure what change
was appropriate:
```
warning: public documentation for `rustc_process` links to private item `self::core::compiler::Context::primary_packages`
   --> src/cargo/core/compiler/compilation.rs:164:22
    |
164 |     /// flag), see [`crate::core::compiler::Context::primary_packages`].
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this item is private
    |
    = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
    = note: this link resolves only because you passed `--document-private-items`, but will break without
```

To avoid noise, this doesn't add an `allow` either.
2021-09-13 18:38:16 +00:00
bors
f7ca659fd3 Auto merge of #9905 - ehuss:wrong-output-error, r=alexcrichton
Improve "wrong output" error.

The error message for an improperly formatted build script output was a bit abrupt and unhelpful.  This adds some more details to the error message.
2021-09-13 18:07:19 +00:00
bors
70967dad28 Auto merge of #9906 - camelid:fix-warnings, r=alexcrichton
Fix warnings from better precision of `dead_code` lint

The lint now ignores derived `Clone` and `Debug` implementations, as of
PR rust-lang/rust#85200, which landed a couple of days ago.

I sprinkled `#[allow(dead_code)]` in a few places; the fields are not
expected to be read since they are just part of a very specific test.
2021-09-13 17:31:11 +00:00
Noah Lev
f6823a6427 Fix warnings from better precision of dead_code lint
The lint now ignores derived `Clone` and `Debug` implementations, as of
PR rust-lang/rust#85200, which landed a couple of days ago.

I sprinkled `#[allow(dead_code)]` in a few places; the fields are not
expected to be read since they are just part of a very specific test.
2021-09-13 10:25:52 -07:00
Eric Huss
c4e92ac69a Improve "wrong output" error. 2021-09-11 16:34:09 -07:00
Eric Huss
f437af3ec3 Add some contributor docs for debugging testsuite tests. 2021-09-11 11:26:38 -07:00
Joshua Nelson
bf62ae9a5a Fix warnings when documenting with --document-private-items
- Use hyperlinks for URLs
- Fix broken intra-doc links

This doesn't fix the following warning, since I wasn't sure what change
was appropriate:
```
warning: public documentation for `rustc_process` links to private item `self::core::compiler::Context::primary_packages`
   --> src/cargo/core/compiler/compilation.rs:164:22
    |
164 |     /// flag), see [`crate::core::compiler::Context::primary_packages`].
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this item is private
    |
    = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
    = note: this link resolves only because you passed `--document-private-items`, but will break without
```

To avoid noise, this doesn't add an `allow` either.
2021-09-11 12:33:45 -05:00
bors
2274489833 Auto merge of #9900 - ehuss:version-bump, r=alexcrichton
Bump to 0.58.0, update changelog
2021-09-10 18:24:27 +00:00
bors
d58c646e95 Auto merge of #9898 - ehuss:rustc-profile-dev, r=alexcrichton
Fix rustc --profile=dev unstable check.

This fixes an oversight from #9685 where `cargo rustc --profile=dev` was accidentally changed to require `-Zunstable-options`.  1.54 and earlier supported that [here](https://github.com/rust-lang/cargo/blob/rust-1.54.0/src/bin/cargo/commands/rustc.rs#L490.

Fixes #9897
2021-09-10 17:54:06 +00:00
Eric Huss
8fe9eca8a5 Update changelog for 1.56 2021-09-10 10:29:28 -07:00
Eric Huss
0603dc0f20 Bump to 0.58.0 2021-09-10 09:47:06 -07:00
Eric Huss
49cf3de927 Fix rustc --profile=dev unstable check. 2021-09-10 09:40:37 -07:00
bors
c7a1c09709 Auto merge of #9896 - frogtile:master, r=ehuss
config.md: fix typo

match  value with comment
2021-09-10 03:37:39 +00:00
frogtile
0fe36b6e2a
config.md: fix typo
match  value with comment
2021-09-10 09:21:34 +06:00
bors
d7f413d682 Auto merge of #9893 - ehuss:windows-echo, r=alexcrichton
Enable some tests on windows.

This enables some more tests on windows that were disabled because `echo` is not always available. It's pretty easy to make a custom `echo`, so that's what this does.  I'm generally not comfortable with disabling tests just because there is an inconvenience like this.
2021-09-09 15:33:04 +00:00
bors
41687275e9 Auto merge of #9889 - ehuss:macos-strip, r=alexcrichton
Enable strip test on macos.

This enables the `strip_works` test for macos, which was fixed a while ago in https://github.com/rust-lang/rust/pull/82037.
2021-09-09 15:03:39 +00:00
bors
b9c27227b0 Auto merge of #9890 - ehuss:remove-z-force-warn, r=alexcrichton
Fix `cargo fix --edition` on stable.

I accidentally missed the removal of a `-Zunstable-options` flag in #9800.  This prevented `cargo fix --edition` from working on stable/beta.
2021-09-09 14:36:06 +00:00
Eric Huss
422d5b030c Enable some tests on windows. 2021-09-08 23:34:37 -07:00
Eric Huss
1ae99dad6e Fix cargo fix --edition on stable. 2021-09-08 21:31:45 -07:00
Eric Huss
9b82a780f3 Enable strip test on macos. 2021-09-08 20:12:35 -07:00
bors
e515c3277b Auto merge of #9873 - hi-rustin:rustin-patch-mask, r=alexcrichton
Remove log output that may leak tokens

close https://github.com/rust-lang/cargo/issues/9822
2021-09-08 14:32:15 +00:00
二手掉包工程师
e3879397e9
Remove log 2021-09-08 20:51:24 +08:00
bors
7d7c37089d Auto merge of #9859 - dtolnay-contrib:pullrequest, r=ehuss
rev = "refs/pull/𑑛/head"

GitHub exposes a named reference associated with the head of every pull request. For example, you can fetch *this* pull request:

```console
$ git fetch origin refs/pull/9859/head
$ git show FETCH_HEAD
```

Usually when I care about pulling in a patch of one of my dependencies using `[patch.crates-io]`, this is the ref that I want to depend on. None of the alternatives are good:

- `{ git = "the fork", branch = "the-pr-branch" }` — this is second closest to what I want, except that when the PR merges and the PR author deletes their fork, it'll breaks.

- `{ git = "the fork", rev = "commithash" }` — same failure mode as the previous. Also doesn't stay up to date with PR, which is sometimes what I want.

- `{ git = "the upstream", rev = "commithash" }` — doesn't work until the PR is merged or the repo owner creates a named branch or tag containing the PR commit among its ancestors, because otherwise the commit doesn't participate in Cargo's fetch.

- `{ git = "my own fork of PR author's repo", branch = "the-pr-branch" }` — doesn't stay up to date with PR.

This PR adds support for specifying a git dependency on the head of a pull request via the existing `rev` setting of git dependencies: `{ git = "the upstream", rev = "refs/pull/9859/head" }`.

Previously this would fail because the `cargo::sources::git::fetch` function touched in this pull request did not fetch the refspec that we care about. The failures look like:

```console
error: failed to get `mockall` as a dependency of package `testing v0.0.0`

Caused by:
  failed to load source for dependency `mockall`

Caused by:
  Unable to update https://github.com/asomers/mockall?rev=refs/pull/330/head

Caused by:
  revspec 'refs/pull/330/head' not found; class=Reference (4); code=NotFound (-3)
```

If dual purposing `rev` for this is not appealing, I would alternatively propose `{ git = "the upstream", pull-request = "9859" }` which Cargo will interpret using GitHub's ref naming convention as `refs/pull/9859/head`.
2021-09-07 17:51:57 +00:00
bors
941b123689 Auto merge of #9877 - dswij:fix-init-bin-help, r=ehuss
Update suggestion message on bad project name error

closes #9876

Error message suggest adding `[bin]` to `Cargo.toml` which should be `[[bin]]` instead.
2021-09-06 14:45:41 +00:00
dswij
cb2932e47b Update help message on bad project name creation [bin] -> [[bin]] 2021-09-06 15:51:52 +08:00
dswij
bd005850d8 Update test output for hint on project creation [bin] -> [[bin]] 2021-09-06 15:51:33 +08:00
bors
a007f97c88 Auto merge of #9871 - davepacheco:issue-9868, r=ehuss
clarify what goes into "*-sys" crates

Fixes #9868
2021-09-04 18:13:44 +00:00
hi-rustin
edad75df5b Mask token with "*"
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-09-04 12:45:45 +08:00
David Pacheco
914949e687 clarify what goes into "*-sys" crates 2021-09-03 10:56:09 -07:00
bors
d405d73f0e Auto merge of #9869 - nipunn1313:errmsg, r=alexcrichton
Improve error message when unable to initialize git index repo

With this - it'll be more obvious which git repo
couldn't be initialized.

Looks like this
```
➜  cargo RUST_BACKTRACE=1 target/debug/cargo build
error: failed to get `anyhow` as a dependency of package `cargo v0.57.0 (/Users/nipunn/src/cargo)`

Caused by:
  failed to initialize index git repository (in "/Users/nipunn/.cargo/registry/index/github.com-1ecc6299db9ec823")

Caused by:
  failed to parse config file: invalid configuration key (in /Users/nipunn/.config/git/config:1); class=Config (7)
```

Does the best we can with #9854 - since I don't think it can actually be fixed.
Fixes #9854
2021-09-03 15:22:58 +00:00
Nipunn Koorapati
168fac4fa3 Improve error message when unable to initialize git index repo
With this - it'll be more obvious which git repo
couldn't be initialized.
2021-09-02 21:09:59 -04:00
bors
8da3cf70cd Auto merge of #9865 - nipunn1313:pkg_in_repo, r=alexcrichton
Use serde_json to generate cargo_vcs_info.json

Should make it easier to add fields in the future
2021-09-02 14:17:23 +00:00
Nipunn Koorapati
08abcc78d1 Use serde_json to generate cargo_vcs_info.json
Should make it easier to add fields in the future
2021-09-02 01:47:25 -04:00
bors
18751dd3f2 Auto merge of #9850 - hi-rustin:rustin-patch-no-track, r=alexcrichton
print the full destination path when no track duplicates

close https://github.com/rust-lang/cargo/issues/9797
2021-09-01 14:26:00 +00:00
bors
ac58670849 Auto merge of #9800 - ehuss:stabilize-2021, r=alexcrichton
Stabilize 2021 edition

This stabilizes the 2021 edition.

Closes #9781
2021-09-01 13:53:35 +00:00
David Tolnay
86276d4ffe
Document the use of rev to depend on pull requests 2021-09-01 00:42:07 -07:00
David Tolnay
19bb1df226
Allow rev = "refs/..." to use the GitHub fast path 2021-09-01 00:42:07 -07:00
David Tolnay
361b11000a
Add test of git dependency on pull request 2021-09-01 00:42:06 -07:00
David Tolnay
256213a655
Allow dependency's rev to refer to a ref by name 2021-09-01 00:42:06 -07:00
Eric Huss
68753e2874 Temporarily move test lockfile_constant_during_new to nightly. 2021-08-31 22:44:34 -07:00
Eric Huss
7a6377092c Make --force-warn support auto-detect. 2021-08-31 22:24:02 -07:00
Eric Huss
e6a783acd4 Stabilize 2021 edition 2021-08-31 22:24:00 -07:00
bors
72aee9e815 Auto merge of #9839 - jonhoo:prefer-cargo-toml-patch, r=ehuss
Stabilize patch-in-config (and prefer config over manifest)

Tracking issue: https://github.com/rust-lang/cargo/issues/9269

---

This stabilizes the `patch-in-config` feature ([unstable entry](https://doc.rust-lang.org/cargo/reference/unstable.html#patch-in-config)) following the discussion in https://github.com/rust-lang/cargo/issues/9269#issuecomment-904913263.

As requested, this PR _also_ changes the precedence behavior such that a `[patch]` for the same dependency in both `.cargo/config.toml` and `Cargo.toml` prefers the patch from the configuration file over the one from the manifest, which matches the behavior of other overlapping configuration options. The corresponding test has also been updated to reflect this change in behavior.
2021-09-01 04:55:13 +00:00
bors
54c341d3d0 Auto merge of #9808 - QiangHeisenberg:examples, r=ehuss
Adding the cargo doc --examples subcommand

Adding the cargo doc --examples subcommand

#4508
2021-09-01 04:28:18 +00:00