Skip to content

More helpful error for invalid cargo-features = [] #15781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 12, 2025

Conversation

kornelski
Copy link
Contributor

The error message for unknown values of cargo-features was unhelpful:

Caused by:
  unknown cargo feature `build-dir`

I've made it more explanatory, and matching the style of the other errors:

Caused by:
  feature `build-dir` is not a valid unstable feature for Cargo.toml

  This feature can be enabled via -Zbuild-dir or the `[unstable]` section in config.toml.
  See https://doc.rust-lang.org/cargo/reference/unstable.html for more information.

@rustbot
Copy link
Collaborator

rustbot commented Jul 28, 2025

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-unstable Area: nightly unstable support S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 28, 2025
@kornelski kornelski force-pushed the feature-error branch 2 times, most recently from adead0c to 794927b Compare July 28, 2025 18:18
@epage
Copy link
Contributor

epage commented Jul 28, 2025

Thanks for working to improve this!

@kornelski kornelski force-pushed the feature-error branch 3 times, most recently from d744ae0 to f1844ee Compare July 29, 2025 01:09
@kornelski kornelski force-pushed the feature-error branch 2 times, most recently from 931489d to 9d87062 Compare August 10, 2025 03:03
Copy link
Contributor

@epage epage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@epage epage added this pull request to the merge queue Aug 12, 2025
Merged via the queue into rust-lang:master with commit ece031c Aug 12, 2025
24 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 12, 2025
bors added a commit to rust-lang/rust that referenced this pull request Aug 16, 2025
Update cargo

23 commits in 840b83a10fb0e039a83f4d70ad032892c287570a..9a0712751ca9444775c7352d3c942a155b656437
2025-07-30 13:59:19 +0000 to 2025-08-15 20:30:47 +0000
- Fixes error while running the cargo clippy --all-targets -- -D warning (rust-lang/cargo#15843)
- Clarify that `cargo doc --no-deps` is cumulative and won’t delete prev (rust-lang/cargo#15800)
- docs: Formatting and cross-linking to build-dir/target-dir docs (rust-lang/cargo#15840)
- Stabilize `build.build-dir` (rust-lang/cargo#15833)
- make resolve features public for cargo-as-a-library (rust-lang/cargo#15835)
- chore(deps): bump slab from 0.4.10 to 0.4.11 (rust-lang/cargo#15832)
- chore: remove x86_64-apple-darwin from CI and tests (rust-lang/cargo#15831)
- chore(deps): update msrv (3 versions) to v1.87 (rust-lang/cargo#15819)
- perf(package): Always reuse the workspace's target-dir (rust-lang/cargo#15783)
- More helpful error for invalid cargo-features = [] (rust-lang/cargo#15781)
- Add initial integration for `--json=timings` behing `-Zsection-timings` (rust-lang/cargo#15780)
- add is_inherited methods to InheritableDependency and InheritableField (rust-lang/cargo#15828)
- chore(deps): update compatible (rust-lang/cargo#15804)
- docs(unstable): Link out to the Plumbing commands effort (rust-lang/cargo#15821)
- chore(deps): update cargo-semver-checks to v0.43.0 (rust-lang/cargo#15825)
- test(build-std): relax the thread name assertion (rust-lang/cargo#15822)
- chore(deps): update msrv (1 version) to v1.89 (rust-lang/cargo#15815)
- Update semver tests for 1.89 (rust-lang/cargo#15816)
- Accessing each build script's `OUT_DIR` and in the correct order (rust-lang/cargo#15776)
- chore: bump to 0.92.0; update changelog (rust-lang/cargo#15807)
- docs: `-Zpackage-workspace` has been stabilized (rust-lang/cargo#15808)
- chore(deps): update rust crate cargo_metadata to 0.21.0 (rust-lang/cargo#15795)
- docs(build-rs): Fix broken intra-doc links (rust-lang/cargo#15810)

r? ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-unstable Area: nightly unstable support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants