Skip to content

Commit bd93d31

Browse files
committed
fix(config): make it clear which element in list is bad
1 parent 22f2745 commit bd93d31

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/cargo/util/context/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2236,7 +2236,7 @@ impl ConfigValue {
22362236
toml::Value::String(val) => Ok((val, def.clone())),
22372237
v => {
22382238
path.push(KeyOrIdx::Idx(i));
2239-
bail!("expected string but found {} in list", v.type_str())
2239+
bail!("expected string but found {} at index {i}", v.type_str())
22402240
}
22412241
})
22422242
.collect::<CargoResult<_>>()?,

tests/testsuite/cargo_alias_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Caused by:
9090
failed to parse config at `alias.b-cargo-test[0]`
9191
9292
Caused by:
93-
expected string but found integer in list
93+
expected string but found integer at index 0
9494
9595
"#]])
9696
.run();

tests/testsuite/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,7 @@ Caused by:
13661366
failed to parse config at `foo[0]`
13671367
13681368
Caused by:
1369-
expected string but found integer in list
1369+
expected string but found integer at index 0
13701370
"#]],
13711371
);
13721372
}

0 commit comments

Comments
 (0)