11423 Commits

Author SHA1 Message Date
l00556901
471e11c16b fix error 2021-09-22 11:08:32 +08:00
l00556901
7bf9a502c0 fmt&Update Code 2021-09-22 10:58:16 +08:00
l00556901
2a55b90d92 Merge branch 'master' of https://github.com/rust-lang/cargo into help
* 'master' of https://github.com/rust-lang/cargo: (21 commits)
  Remove TOML incompatibility hacks
  Use a more compact way to compare versions
  Remove broken link in contrib docs.
  Change diesel compatibility messages
  Temporarily revert curl-sys update.
  Update curl-sys
  Bump Cargo's curl requirement to 7.79.0
  Revert "When a dependency does not have a version, git or path, fails directly"
  Fix warnings from better precision of `dead_code` lint
  Improve "wrong output" error.
  Add some contributor docs for debugging testsuite tests.
  Fix warnings when documenting with `--document-private-items`
  Update changelog for 1.56
  Bump to 0.58.0
  Fix rustc --profile=dev unstable check.
  config.md: fix typo
  Enable some tests on windows.
  Fix `cargo fix --edition` on stable.
  Enable strip test on macos.
  Remove log
  ...
2021-09-22 10:28:16 +08:00
l00556901
e8519ec090 Fix the problem that help cannot be displayed properly 2021-09-22 10:16:22 +08:00
bors
790b01f1e7 Auto merge of #9932 - epage:hacks, r=alexcrichton
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 20:34:24 +00:00
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
e79ba78087 Auto merge of #9927 - weiznich:diesel_2021_edition, r=ehuss
Change diesel compatibility messages

Diesel 1.4.8 fixes the critical behaviour. This commit changes the
corresponding messages for `cargo fix` and normal builds to prompt the
user to just update the diesel version to fix the corresponding
compilation errors.

As discussed in https://github.com/rust-lang/rust/issues/88903#issuecomment-923061946

Fixes https://github.com/rust-lang/rust/issues/88903
Fixes #9450
2021-09-21 15:24:03 +00:00
bors
4bfcf56aa1 Auto merge of #9928 - ehuss:contrib-githelp, r=alexcrichton
Remove broken link in contrib docs.

I don't think this point is particularly important, so I'm just removing it.
2021-09-21 14:30:57 +00:00
Georg Semmler
dd03e40698
Use a more compact way to compare versions 2021-09-21 09:32:37 +02:00
Eric Huss
e8de0ac292 Remove broken link in contrib docs.
I don't think this point is particularly important, so I'm just removing it.
2021-09-20 14:43:30 -07:00
Georg Semmler
09374c56d1
Change diesel compatibility messages
Diesel 1.4.8 fixes the critical behaviour. This commit changes the
corresponding messages for `cargo fix` and normal builds to promt the
user to just update the diesel version to fix the corresponding
compilation errors.
2021-09-20 21:20:26 +02:00
Alex Crichton
9a28ac83c9
Merge pull request #9920 from ehuss/revert-curl-sys
Temporarily revert curl-sys update.
2021-09-18 15:42:28 -05:00
Eric Huss
637ee66375 Temporarily revert curl-sys update. 2021-09-18 12:43:14 -07:00
bors
33ee5f82ed Auto merge of #9917 - ehuss:update-curl-sys, r=alexcrichton
Update curl-sys

Updates to 0.4.47 to bring in https://github.com/alexcrichton/curl-rust/pull/406.
2021-09-17 13:51:54 +00:00
Eric Huss
28eb20305c Update curl-sys 2021-09-17 03:04:06 -07: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