Commit graph

121 commits

Author SHA1 Message Date
hi-rustin 21b2fe98a4 Fix fix_in_existing_repo_weird_ignore broken test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-11-26 20:15:36 +08:00
hi-rustin 3189dc3b06 Include untracked files
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-11-26 20:15:36 +08:00
hi-rustin 25f7d4b09a Remove new_repo_without_add_and_commit
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-11-26 20:15:36 +08:00
hi-rustin 89b8a8bb10 Suppress error with --allow-dirty and add a test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-11-26 20:15:36 +08:00
Eric Huss 1c3640e05c Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
Scott Schafer c239e407e7 add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
Scott Schafer 4bc8fe85bd remove unneeded nightly flags from various tests 2022-07-14 19:55:44 -05:00
Weihang Lo d813739c76
test: make tests compatible when force using argfile 2022-04-10 22:23:20 +08:00
Eric Huss 88117505b8 Bump to 0.59.0 2021-10-22 07:53:17 -07:00
Weihang Lo 0565dafd87
Skip all cargo fix that tends to write to registry cache. 2021-09-23 23:31:10 +08:00
Eric Huss 7a6377092c Make --force-warn support auto-detect. 2021-08-31 22:24:02 -07:00
Eric Huss 46450d6e3a Change cargo fix --edition to only fix edition lints. 2021-08-27 11:28:03 -07:00
Eric Huss e0bd1877d0 Fix test not to rely on cargo in PATH. 2021-08-26 14:06:32 -07:00
bors 3f68ff4fe3 Auto merge of #9818 - hi-rustin:rustin-patch-fix, r=alexcrichton
unset the FIX_ENV when executing the real rustc

close https://github.com/rust-lang/cargo/issues/9706
2021-08-23 17:03:28 +00:00
bors 8b5771f05e Auto merge of #9792 - weihanglo:issue-9782, r=ehuss
Emit warning for migrating to unstable edition in stable channel

Resolves #9782

Also alter the original error message slightly.
2021-08-23 16:07:05 +00:00
hi-rustin 4c11002b9d Better fmt for file body
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-08-21 23:54:59 +08:00
hi-rustin 4225c46297 unset the FIX_ENV when executing the real rustc
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-08-21 23:48:49 +08:00
bors 259ea8c055 Auto merge of #9803 - ehuss:fix-edition-resolve-differences-dev-deps, r=alexcrichton
Show feature resolver differences for dev-dependencies.

During the crater run for 2021, there was a package that failed to update in a confusing way. The issue is that a feature was removed in the new resolver, but only for a dev-dependency. The report displayed with `cargo fix --edition` did not say anything about that, so it took me a bit to figure it out.  This changes it so that the report also includes changes to features of dev-dependencies.  I honestly don't remember my thought process behind the original code.

For example, the offending package now says:

```
When building the following dependencies, the given features will no longer be used:

  log v0.4.8 removed features: std
  syn v0.15.44 (as host dependency) removed features: extra-traits, visit

The following differences only apply when building with dev-dependencies:

  phf_shared v0.7.24 (as host dependency) removed features: unicase
```

And the error that happens after updating to 2021 is:

```
error[E0277]: the trait bound `UniCase<&str>: phf_shared::PhfHash` is not satisfied
  --> /Users/eric/.cargo/registry/src/github.com-1ecc6299db9ec823/mime_guess-1.8.7/build.rs:37:21
   |
37 |         forward_map.entry(UniCase(key), &format!("{:?}", val));
   |                     ^^^^^ the trait `phf_shared::PhfHash` is not implemented for `UniCase<&str>`
```

Hopefully developers will be able to see the note about the feature `unicase` being removed from `phf_shared`, and the error message about `UniCase` not implementing `PhfHash`, and connect the two together.  Previously, the upgrade report didn't mention anything about `phf_shared`, and thus no clues on what went wrong.
2021-08-18 14:09:06 +00:00
Eric Huss 5939e212e0 Show feature resolver differences for dev-dependencies. 2021-08-17 16:41:53 -07:00
Eric Huss 5f274b018f Show information about abnormal fix errors. 2021-08-17 08:49:47 -07:00
Weihang Lo e5d6586cf8
Test for warning of migrating to unstable edition 2021-08-15 17:16:39 +08:00
Eric Huss be0cbb57c7 cargo fix --edition: extend warning when on latest edition 2021-07-15 07:26:26 -07:00
bors f2496ee6ee Auto merge of #9677 - ehuss:serialize-fix, r=alexcrichton
Serialize `cargo fix`

This changes `cargo fix` so that it only fixes one crate at a time. Previously, it would allow concurrent fixing across packages. This caused a problem if a workspace uses things like `#[path]` or `include!()` of a shared file between packages. A real-world example of this is serde, which has [this](9c39115f82/serde_derive_internals/lib.rs (L43-L45)) which reuses the some source files between the `serde` and `serde_derive` packages. Modifying those files concurrently causes corruption and the fix will fail.

Closes #6528
2021-07-12 16:16:36 +00:00
bors a51667c60d Auto merge of #9662 - ehuss:unignore-fix_edition_2021, r=alexcrichton
Unignore fix_edition_2021.

The issue has been fixed by https://github.com/rust-lang/rust/pull/86572.
2021-07-12 13:39:49 +00:00
Eric Huss c8e4f8e483 Serialize cargo fix 2021-07-10 18:47:52 -07:00
Eric Huss 93658ee1be Unignore fix_edition_2021. 2021-07-06 19:28:13 -07:00
Joshua Nelson 9c7cc545d7 Combine rustc and cargo's diagnostic summaries
This works by introspecting rustc's error output, using the JSON format
to determine whether it's a warning or error, then skipping it
altogether if it's a summary of the diagnostics printed.

Before:

```
src/main.rs:1:10: warning: trait objects without an explicit `dyn` are deprecated
src/main.rs:1:1: error[E0601]: `main` function not found in crate `wrong`
src/main.rs:1:9: error[E0038]: the trait `Clone` cannot be made into an object
error: aborting due to 2 previous errors; 1 warning emitted
error: could not compile `wrong`

```

After:

```
$ cargo check --message-format short
src/main.rs:1:10: warning: trait objects without an explicit `dyn` are deprecated
src/main.rs:1:1: error[E0601]: `main` function not found in crate `wrong`
src/main.rs:1:9: error[E0038]: the trait `Clone` cannot be made into an object
error: could not compile `wrong` due to 2 previous errors; 1 warning emitted
```
2021-07-06 19:46:27 -04:00
Eric Huss 5559e028a8 Adjust the edition2021 resolver diff report. 2021-07-02 13:01:58 -07:00
Eric Huss aab51362d7 Temporarily ignore 2021 edition fix. 2021-06-30 09:36:22 -07:00
Eric Huss 5825206acf Enable support for fix --edition for 2021. 2021-06-15 13:13:35 -07:00
Sunjay Varma f68cdb9947 Change how the fix_deny_warnings_but_not_others test works to avoid breakage from new compiler suggestions 2021-06-10 16:49:29 -07:00
bors 40b674cd11 Auto merge of #9566 - ehuss:relative-rustc-path, r=alexcrichton
Fix rustc/rustdoc config values to be config-relative.

The `rustc`, `rustdoc`, `rustc_wrapper`, and `rustc_workspace_wrapper` config values (in the `[build]` table) were being interpreted literally. This caused a problem if you used a relative path like `foo/rustc`.  This would be interpreted as a relative path from whatever cwd cargo launches rustc from, which changes for different scenarios, making it essentially unusuable (since crates.io dependencies wouldn't be buildable).

Additionally, due to https://github.com/rust-lang/rust/issues/37868, it is a bad idea to use relative paths.

This changes it so that those paths are config-relative.  Bare names (like "my-rustc-program") still use PATH as before.

This also includes a commit to centralize the rustc-wrapper program used by several tests so that it isn't built multiple times (and to allow several tests to work on windows).

Fixes #8202
2021-06-10 14:15:18 +00:00
Eric Huss 9362fe5ff3 Update rustfix. 2021-06-09 18:13:56 -07:00
Eric Huss 7b229bbe39 Move the rustc-echo-wrapper to be shared across tests.
This helps avoid rebuilding the same project several times.
2021-06-09 17:13:33 -07:00
Yuki Okushi e5ab39145f Only deny the unused_mut lint 2021-04-28 17:59:57 +09:00
Eric Huss 501499c5f9 Add report if cargo fix --edition changes features. 2021-03-16 11:39:21 -07:00
Eric Huss c303213748 cargo fix: Remove --prepare-for option.
This was deprecated, never officially part of the stable release.
2021-02-19 14:29:45 -08:00
Eric Huss aa61976c5f Make edition transitions easier.
This attempts to centralize all the edition stuff in one place (the
`Edition` enum) so that adding a new edition or stabilizing one should
be relatively little work (and more importantly, we don't miss things).

Importantly, this changes `cargo new` to default to the latest stable.
It also changes the `cargo fix --edition-idiom` behavior to only apply
idioms for the *current* edition.
2021-02-19 14:29:44 -08:00
Eric Huss 28850225a1 Updates to cargo fix --edition.
* `--edition` always means "next" edition.
* `--edition` when on the most recent edition is not an error, just a warning.
* Support fix to 2021 edition.
2021-02-17 22:12:46 -08:00
Eric Huss 3f2f7e30ff Add a migrating message for cargo fix --edition.
This helps indicate which edition you are moving from and to.
2021-02-17 21:36:28 -08:00
Eric Huss 820537c706 Change Fixing to Fixed, and add a verbose "Fixing".
What was previously "Fixing" was a message for after the fixes had
been applied. I think it would be clearer if it said "Fixed",
to indicate that the fixes had actually finished.

The new "Fixing" is posted just before it starts. This is verbose-only
since it is a little noisy.
2021-02-17 20:41:38 -08:00
Eduardo Broto f838a003f1 Stabilize RUSTC_WORKSPACE_WRAPPER 2020-12-13 23:50:15 +01:00
Eric Huss 6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Camelid 82c834cec2 Update tests 2020-09-07 10:57:00 -07:00
Andy Russell 537a020267
relax deprecated diagnostic message check 2020-07-30 21:04:45 -04:00
Eric Huss 4ae79d2ffd Use fs helpers instead of File functions. 2020-04-17 07:56:16 -07:00
Jane Lusby d9a77ce0d0 fix unix cfg on include 2020-03-13 15:31:33 -07:00
Jane Lusby 76797b5c2a switch from bash script to rust program 2020-03-13 14:59:41 -07:00
Jane Lusby b0351e4d87 Close the front door for clippy but open the back 2020-03-12 19:27:48 -07:00
Kinrany bc4c65c5d3 Do not run formats_source if rustfmt is not available
Generalized `clippy_is_available` and renamed as `command_is_available`.

No checks in `ignores_failure_to_format_source`, it's not supposed to
use `rustfmt` even if it's available
2020-02-05 10:09:43 +03:00