Skip to content

Commit 1f11a51

Browse files
Jon GjengsetHezuikn
Jon Gjengset
authored andcommitted
Allow --config path without config-include
As per rust-lang#7722 (comment)
1 parent 766acbc commit 1f11a51

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cargo/util/config/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,7 @@ impl Config {
11651165
Some(cli_args) => cli_args,
11661166
None => return Ok(loaded_args),
11671167
};
1168+
let mut seen = HashSet::new();
11681169
for arg in cli_args {
11691170
let arg_as_path = self.cwd.join(arg);
11701171
let tmp_table = if !arg.is_empty() && arg_as_path.exists() {
@@ -1175,9 +1176,8 @@ impl Config {
11751176
anyhow::format_err!("config path {:?} is not utf-8", arg_as_path)
11761177
})?
11771178
.to_string();
1178-
let value = CV::String(str_path, Definition::Cli);
1179-
let map = HashMap::from([("include".to_string(), value)]);
1180-
CV::Table(map, Definition::Cli)
1179+
self._load_file(&self.cwd().join(&str_path), &mut seen, true)
1180+
.with_context(|| format!("failed to load config from `{}`", str_path))?
11811181
} else {
11821182
// We only want to allow "dotted key" (see https://toml.io/en/v1.0.0#keys)
11831183
// expressions followed by a value that's not an "inline table"

0 commit comments

Comments
 (0)