37 Commits

Author SHA1 Message Date
Daniel McNab
378f021a34 Suggest relevant feature names on the CLI
The left-aligned error message is there to
workaround rustfmt refusing to format files
which contain string literals which are too
wide. I have not found a consistent way to
fix this behaviour, but left-aligning does
resolve it in this case. I believe that this
should have an explanatory comment, but code
review determined that to be "noise" and so
I removed it.
2025-02-04 18:33:15 +00:00
Daniel McNab
b0dc18d158 Add new tests 2025-02-04 18:24:48 +00:00
Ed Page
e78a8a19db fix: Align new help messages with their error 2025-02-04 10:46:09 -06: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
af3cfd5abe fix(test): Un-deprecate contains assertions 2024-11-07 15:55:35 -06:00
Ed Page
a6cf1be655 test: Switch from allow to expect deprecated
This caught a couple of lingering items.
2024-09-23 20:44:06 -05:00
bors
ef854d2f66 Auto merge of #14445 - epage:locked, r=weihanglo
fix(resolve): Dont show locking workspace members

### What does this PR try to resolve?
This is for `cargo generate-lockfile` and when syncing the lockfile with
the manifest.
We still show it for `cargo update` because of `cargo update
--workspace`.

We hacked around this previously by filtering out the `num_pkgs==1` case
for single packages but this didn't help with workspaces.

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

### Additional information

This builds on #14440
2024-08-26 22:16:00 +00:00
Kornel
e8b28cf87e
More helpful missing feature error message 2024-08-24 02:24:32 +01:00
Ed Page
d2ec764995 fix(resolve): Dont show locking workspace members
This is for `cargo generate-lockfile` and when syncing the lockfile with
the manifest.
We still show it for `cargo update` because of `cargo update
--workspace`.

We hacked around this previously by filtering out the `num_pkgs==1` case
for single packages but this didn't help with workspaces.
2024-08-22 16:57:06 -05:00
Ed Page
5b9799c6f4 refactor: Migrate from extern crate to test-support prelude
We now include the prelude in so many places, this simplifies how we can
present how `cargo-test-support` works.

Yes, this included some `use` clean ups but its already painful enough
walking through every test file, I didn't want to do it twice.
2024-07-12 15:57:00 -05:00
eth3lbert
a625d20b03
test: migrate package_features to snapbox 2024-06-27 12:55:34 +08:00
Ed Page
dc5ac62cab fix(test): Deprecate non-snapbox assertions
While this is noisy and hides other deprecations, I figured deprecations would
make it easier for people to discover what tasks remain and allow us to
divide and conquer this work rather than doing a heroic PR.
In theory, this will be short lived and we'll go back to seeing
deprecations in our tests.
2024-06-10 10:20:52 -05:00
Urgau
388a17f23f Update regular tests for always-on check-cfg 2024-05-01 12:56:04 +02:00
Ed Page
1876326b6b feat(resolve): Tell the user the style of resovle done
This is to help with #9930

Example changes:
```diff
-[LOCKING] 4 packages
+[LOCKING] 4 packages to latest version
-[LOCKING] 2 packages
+[LOCKING] 2 packages to latest Rust 1.60.0 compatible versions
-[LOCKING] 2 packages
+[LOCKING] 2 packages to earliest versions
```

Benefits
- The package count is of "added" packages and this makes that more
  logically clear
- This gives users transparency into what is happening, especially with
  - what rust-version is use
  - the transition to this feature in the new edition
  - whether the planned config was applied or not (as I don't want it to
    require an MSRV bump)
- Will make it easier in tests to show what changed
- Provides more motiviation to show this message in `cargo update` and
  `cargo install` (that will be explored in a follow up PR)

This does come at the cost of more verbose output but hopefully not too
verbose.  This is why I left off other factors, like avoid-dev-deps.
2024-04-13 20:39:59 -05:00
Ed Page
4ab2797f36 feat(lock): Print lockfile changes on all commands 2024-03-12 13:39:56 -05:00
Ed Page
14646e6af6 test: Make edition explicit on packages 2024-02-22 11:37:03 -06:00
Scott Schafer
7b14e72cc6 chore: update package_features tests to use check 2023-02-20 12:21:27 -06:00
Will Crichton
39e6737de7 Change rustdoc-scrape-examples to be a target-level configuration 2022-11-16 09:18:33 -08:00
Scott Schafer
4bc8fe85bd remove unneeded nightly flags from various tests 2022-07-14 19:55:44 -05:00
bors
5fb59b0e4a Auto merge of #9420 - In-line:unknown-features-suggestions-in-workspace, r=ehuss
Implement suggestions for unknown features in workspace
2021-06-01 15:41:27 +00:00
Eric Huss
61b762b9ff Remove unneeded masquerade_as_nightly_cargo.
This was accidentally missed when it was stabilized.
2021-05-24 08:18:14 -07:00
Alik Aslanyan
503a8670d9
Another way to fix 2021-05-13 11:30:46 +04:00
Alik Aslanyan
21152659a1 Move check to the end of function, rework error message 2021-05-06 09:31:22 +04:00
Alik Aslanyan
8c4b0a8559
Remove trailing space 2021-05-03 09:08:53 +00:00
Alik Aslanyan
f46145312c Fix bug when with resolver = "1" non-virtual package was allowing unknown features 2021-05-03 13:06:34 +04:00
Alik Aslanyan
f2b5271a09
Cargo fmt 2021-04-30 10:55:36 +04:00
Alik Aslanyan
e80b5c2f8b
Add failing test 2021-04-30 10:47:44 +04:00
Alik Aslanyan
1439dab8c0
Add failing tests & fix them 2021-04-30 09:56:24 +04:00
Alik Aslanyan
3786b27367
Update test 2021-04-27 09:36:07 +00:00
Alik Aslanyan
0847630d07
Implement suggestions for unknown features in workspace 2021-04-27 13:09:44 +04:00
Eric Huss
85854b1884 Refactor feature handling, and improve error messages. 2021-03-19 14:59:53 -07:00
Eric Huss
6b320cb801 Fix --feature pkg/feat for V1 resolver for non-member. 2021-03-14 19:05:12 -07:00
Eric Huss
d087aeb845 Stabilize -Zfeatures and -Zpackage-features. 2020-12-19 08:26:42 -08:00
Eric Huss
bcfdf9fbad New namespaced features implementation. 2020-10-23 16:04:41 -07:00
Ivan Tham
894dbbc997
Suggest manifest for --features help
Suggested by ehuss
2020-10-14 10:00:02 +08:00
Ivan Tham
ca91c5db5c
Fix test for package_features for help 2020-10-14 01:06:16 +08:00
Eric Huss
54ace8af65 Merge -Zpackage-features2 and -Zpackage-features. 2020-04-08 14:06:09 -07:00