mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
fix(config): make it clear which element in list is bad
This commit is contained in:
parent
22f2745066
commit
bd93d31b30
@ -2236,7 +2236,7 @@ impl ConfigValue {
|
|||||||
toml::Value::String(val) => Ok((val, def.clone())),
|
toml::Value::String(val) => Ok((val, def.clone())),
|
||||||
v => {
|
v => {
|
||||||
path.push(KeyOrIdx::Idx(i));
|
path.push(KeyOrIdx::Idx(i));
|
||||||
bail!("expected string but found {} in list", v.type_str())
|
bail!("expected string but found {} at index {i}", v.type_str())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect::<CargoResult<_>>()?,
|
.collect::<CargoResult<_>>()?,
|
||||||
|
@ -90,7 +90,7 @@ Caused by:
|
|||||||
failed to parse config at `alias.b-cargo-test[0]`
|
failed to parse config at `alias.b-cargo-test[0]`
|
||||||
|
|
||||||
Caused by:
|
Caused by:
|
||||||
expected string but found integer in list
|
expected string but found integer at index 0
|
||||||
|
|
||||||
"#]])
|
"#]])
|
||||||
.run();
|
.run();
|
||||||
|
@ -1366,7 +1366,7 @@ Caused by:
|
|||||||
failed to parse config at `foo[0]`
|
failed to parse config at `foo[0]`
|
||||||
|
|
||||||
Caused by:
|
Caused by:
|
||||||
expected string but found integer in list
|
expected string but found integer at index 0
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user