From 17a2bce2f10d5fdabbbf9aa637b2263f8da9ea85 Mon Sep 17 00:00:00 2001 From: Basile Henry Date: Wed, 1 Feb 2023 08:21:03 +0100 Subject: [PATCH] config: Improve wording of CARGO_HOME in [env] error --- src/cargo/util/config/mod.rs | 2 +- tests/testsuite/cargo_env_config.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cargo/util/config/mod.rs b/src/cargo/util/config/mod.rs index dbf4e3d53b6..53badb21287 100644 --- a/src/cargo/util/config/mod.rs +++ b/src/cargo/util/config/mod.rs @@ -1690,7 +1690,7 @@ impl Config { .try_borrow_with(|| self.get::("env"))?; if env_config.get("CARGO_HOME").is_some() { - bail!("`CARGO_HOME` environment variable should be not be set in `.cargo/config` via `env.CARGO_HOME` as cargo does not use this value directly (only recursive calls to cargo would)"); + bail!("setting the `CARGO_HOME` environment variable is not supported in the `[env]` configuration table") } Ok(env_config) diff --git a/tests/testsuite/cargo_env_config.rs b/tests/testsuite/cargo_env_config.rs index 76f81e9b797..1872d56c004 100644 --- a/tests/testsuite/cargo_env_config.rs +++ b/tests/testsuite/cargo_env_config.rs @@ -79,7 +79,7 @@ fn env_no_cargo_home() { p.cargo("build") .with_status(101) - .with_stderr_contains("[..]`CARGO_HOME` environment variable should be not be set in `.cargo/config` via `env.CARGO_HOME` as cargo does not use this value directly (only recursive calls to cargo would)") + .with_stderr_contains("[..]setting the `CARGO_HOME` environment variable is not supported in the `[env]` configuration table") .run(); }