Skip to content

Commit c7f6528

Browse files
committed
Add some context to a [target] links deserialize error.
1 parent 00a4730 commit c7f6528

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/cargo/core/compiler/custom_build.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,12 @@ impl<'de> serde::Deserialize<'de> for BuildOutput {
773773
// require an intermediate step to translate LinksOverride to
774774
// BuildOutput, converting the ConfigRelativePath values to PathBuf.
775775

776-
let lo = LinksOverride::deserialize(deserializer)?;
776+
let lo = LinksOverride::deserialize(deserializer).map_err(|e| {
777+
serde::de::Error::custom(format!(
778+
"failed to load config [target] links override table: {}",
779+
e
780+
))
781+
})?;
777782
if lo.warning.is_some() {
778783
return Err(Error::custom(
779784
"`warning` is not supported in build script overrides",

0 commit comments

Comments
 (0)