Skip to content

Commit

Permalink
config: Improve wording of CARGO_HOME in [env] error
Browse files Browse the repository at this point in the history
  • Loading branch information
basile-henry committed Feb 1, 2023
1 parent d09e132 commit 17a2bce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cargo/util/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ impl Config {
.try_borrow_with(|| self.get::<EnvConfig>("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)
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/cargo_env_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 17a2bce

Please sign in to comment.