From c7f6528ef929be784e5f6ad6f331847d7c9b3c72 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 2 Dec 2019 18:01:49 -0800 Subject: [PATCH] Add some context to a [target] links deserialize error. --- src/cargo/core/compiler/custom_build.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cargo/core/compiler/custom_build.rs b/src/cargo/core/compiler/custom_build.rs index ed3cf530c..2dc69fbf1 100644 --- a/src/cargo/core/compiler/custom_build.rs +++ b/src/cargo/core/compiler/custom_build.rs @@ -773,7 +773,12 @@ impl<'de> serde::Deserialize<'de> for BuildOutput { // require an intermediate step to translate LinksOverride to // BuildOutput, converting the ConfigRelativePath values to PathBuf. - let lo = LinksOverride::deserialize(deserializer)?; + let lo = LinksOverride::deserialize(deserializer).map_err(|e| { + serde::de::Error::custom(format!( + "failed to load config [target] links override table: {}", + e + )) + })?; if lo.warning.is_some() { return Err(Error::custom( "`warning` is not supported in build script overrides",