From b81b7ed24f606e9bb36a7ec86c292e00c8be9f9d Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 17 Apr 2024 23:09:29 +0900 Subject: [PATCH] Make mutually-exclusive-features implies exclude-all-features Fixes #250 --- CHANGELOG.md | 2 ++ src/cli.rs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c882e87..9050747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com ## [Unreleased] +- Fix bug in `--mutually-exclusive-features` option. ([#250](https://github.com/taiki-e/cargo-hack/issue/250)) + ## [0.6.27] - 2024-04-02 - Adjust command order of `--each-feature`/`--feature-powerset` to early run a case that is likely to find a problem. ([#247](https://github.com/taiki-e/cargo-hack/pull/247)) diff --git a/src/cli.rs b/src/cli.rs index 752bf64..f0c5b6f 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -587,7 +587,9 @@ impl Args { // https://github.com/taiki-e/cargo-hack/issues/42 // https://github.com/rust-lang/cargo/pull/8799 exclude_no_default_features |= !include_features.is_empty(); - exclude_all_features |= !include_features.is_empty() || !exclude_features.is_empty(); + exclude_all_features |= !include_features.is_empty() + || !exclude_features.is_empty() + || !mutually_exclusive_features.is_empty(); exclude_features.extend_from_slice(&features); term::verbose::set(verbose != 0);