Skip to content

Commit fc43bf8

Browse files
committed
refactor: use built-in definition for root cv container
The root config value container isn't from any external source, so its definition should be built-in.
1 parent 8b3728c commit fc43bf8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/cargo/util/context/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,9 +1286,9 @@ impl GlobalContext {
12861286

12871287
/// Start a config file discovery from a path and merges all config values found.
12881288
fn load_values_from(&self, path: &Path) -> CargoResult<HashMap<String, ConfigValue>> {
1289-
// This definition path is ignored, this is just a temporary container
1290-
// representing the entire file.
1291-
let mut cfg = CV::Table(HashMap::new(), Definition::Path(PathBuf::from(".")));
1289+
// The root config value container isn't from any external source,
1290+
// so its definition should be built-in.
1291+
let mut cfg = CV::Table(HashMap::new(), Definition::BuiltIn);
12921292
let home = self.home_path.clone().into_path_unlocked();
12931293

12941294
self.walk_tree(path, &home, |path| {
@@ -1550,9 +1550,9 @@ impl GlobalContext {
15501550
assert!(cv_from_cli.is_table(), "cv from CLI must be a table");
15511551

15521552
let root_cv = mem::take(self.values_mut()?);
1553-
// This definition path is ignored, this is just a temporary container
1554-
// representing the entire file.
1555-
let mut root_cv = CV::Table(root_cv, Definition::Path(PathBuf::from(".")));
1553+
// The root config value container isn't from any external source,
1554+
// so its definition should be built-in.
1555+
let mut root_cv = CV::Table(root_cv, Definition::BuiltIn);
15561556
root_cv.merge(cv_from_cli, true)?;
15571557

15581558
// Put it back to gctx

0 commit comments

Comments
 (0)