diff --git a/src/cargo/core/registry.rs b/src/cargo/core/registry.rs index 724035bf1ef..63d2c64f32c 100644 --- a/src/cargo/core/registry.rs +++ b/src/cargo/core/registry.rs @@ -312,8 +312,8 @@ impl<'gctx> PackageRegistry<'gctx> { if dep.features().len() != 0 || !dep.uses_default_features() { self.source_config.gctx().shell().warn(format!( - "patch for `{}` uses the features mechanism. \ - default-features and features will not take effect because the patch dependency does not support this mechanism", + "patch for `{}` attempts to declare features. \ + The `features` and `default-features` keys need to appear in a `dependencies` entry, not the `patch` entry.", dep.package_name() ))?; } diff --git a/src/cargo/ops/resolve.rs b/src/cargo/ops/resolve.rs index 875edcb7e6b..767e5653280 100644 --- a/src/cargo/ops/resolve.rs +++ b/src/cargo/ops/resolve.rs @@ -165,8 +165,8 @@ pub fn resolve_ws_with_opts<'gctx>( ws.gctx() .shell() .warn(format!( - "replacement for `{}` uses the features mechanism. \ - default-features and features will not take effect because the replacement dependency does not support this mechanism", + "replacement for `{}` attempts to declare features. \ + The `features` and `default-features` keys need to appear in a `dependencies` entry, not the `replace` entry.", dep.package_name() ))? } diff --git a/tests/testsuite/patch.rs b/tests/testsuite/patch.rs index e4b0d6ff0f4..7d27648a0bf 100644 --- a/tests/testsuite/patch.rs +++ b/tests/testsuite/patch.rs @@ -883,8 +883,8 @@ fn add_patch_with_features() { p.cargo("check") .with_stderr( "\ -[WARNING] patch for `bar` uses the features mechanism. \ -default-features and features will not take effect because the patch dependency does not support this mechanism +[WARNING] patch for `bar` attempts to declare features. \ +The `features` and `default-features` keys need to appear in a `dependencies` entry, not the `patch` entry. [UPDATING] `dummy-registry` index [CHECKING] bar v0.1.0 ([CWD]/bar) [CHECKING] foo v0.0.1 ([CWD]) @@ -895,8 +895,8 @@ default-features and features will not take effect because the patch dependency p.cargo("check") .with_stderr( "\ -[WARNING] patch for `bar` uses the features mechanism. \ -default-features and features will not take effect because the patch dependency does not support this mechanism +[WARNING] patch for `bar` attempts to declare features. \ +The `features` and `default-features` keys need to appear in a `dependencies` entry, not the `patch` entry. [FINISHED] [..] ", ) @@ -932,8 +932,8 @@ fn add_patch_with_setting_default_features() { p.cargo("check") .with_stderr( "\ -[WARNING] patch for `bar` uses the features mechanism. \ -default-features and features will not take effect because the patch dependency does not support this mechanism +[WARNING] patch for `bar` attempts to declare features. \ +The `features` and `default-features` keys need to appear in a `dependencies` entry, not the `patch` entry. [UPDATING] `dummy-registry` index [CHECKING] bar v0.1.0 ([CWD]/bar) [CHECKING] foo v0.0.1 ([CWD]) @@ -944,8 +944,8 @@ default-features and features will not take effect because the patch dependency p.cargo("check") .with_stderr( "\ -[WARNING] patch for `bar` uses the features mechanism. \ -default-features and features will not take effect because the patch dependency does not support this mechanism +[WARNING] patch for `bar` attempts to declare features. \ +The `features` and `default-features` keys need to appear in a `dependencies` entry, not the `patch` entry. [FINISHED] [..] ", ) diff --git a/tests/testsuite/replace.rs b/tests/testsuite/replace.rs index 71b691de345..16970d71ff1 100644 --- a/tests/testsuite/replace.rs +++ b/tests/testsuite/replace.rs @@ -93,8 +93,8 @@ fn override_with_features() { "\ [UPDATING] [..] index [UPDATING] git repository `[..]` -[WARNING] replacement for `bar` uses the features mechanism. default-features and features \ -will not take effect because the replacement dependency does not support this mechanism +[WARNING] replacement for `bar` attempts to declare features. \ +The `features` and `default-features` keys need to appear in a `dependencies` entry, not the `replace` entry. [CHECKING] bar v0.1.0 (file://[..]) [CHECKING] foo v0.0.1 ([CWD]) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..] @@ -143,8 +143,8 @@ fn override_with_setting_default_features() { "\ [UPDATING] [..] index [UPDATING] git repository `[..]` -[WARNING] replacement for `bar` uses the features mechanism. default-features and features \ -will not take effect because the replacement dependency does not support this mechanism +[WARNING] replacement for `bar` attempts to declare features. \ +The `features` and `default-features` keys need to appear in a `dependencies` entry, not the `replace` entry. [CHECKING] bar v0.1.0 (file://[..]) [CHECKING] foo v0.0.1 ([CWD]) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]