From 3a6bea6b26d3a698c46ba9eb2b2c0b774ffa8e99 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Fri, 30 Sep 2022 22:34:42 +0100 Subject: [PATCH] Explain why we keep -Zfeatures=compare --- src/cargo/core/features.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/cargo/core/features.rs b/src/cargo/core/features.rs index b08f82add..020485355 100644 --- a/src/cargo/core/features.rs +++ b/src/cargo/core/features.rs @@ -931,10 +931,13 @@ impl CliUnstable { "host-config" => self.host_config = parse_empty(k, v)?, "target-applies-to-host" => self.target_applies_to_host = parse_empty(k, v)?, "features" => { - // For now this is still allowed (there are still some - // unstable options like "compare"). This should be removed at - // some point, and migrate to a new -Z flag for any future - // things. + // `-Z features` has been stabilized since 1.51, + // but `-Z features=compare` is still allowed for convenience + // to validate that the feature resolver resolves features + // in the same way as the dependency resolver, + // until we feel confident to remove entirely. + // + // See rust-lang/cargo#11168 let feats = parse_features(v); let stab_is_not_empty = feats.iter().any(|feat| { matches!(