From: bors Date: Mon, 18 Dec 2017 15:13:48 +0000 (+0000) Subject: Auto merge of #4828 - SimonSapin:virtual-err, r=alexcrichton X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~4^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=510cf5eb754ad0fc819796b4dbe9d46cf1db7838;p=cargo.git Auto merge of #4828 - SimonSapin:virtual-err, r=alexcrichton Don’t swallow virtual manifest parsing errors Before this change, `cargo::util::toml::do_read_manifest` ended like this: ```rust return match TomlManifest::to_real_manifest(/* … */) { Ok(/* … */) => /* … */, Err(e) => match TomlManifest::to_virtual_manifest(/* … */) { Ok(/* … */) => /* … */, Err(..) => Err(e), } }; ``` Errors returned by `to_virtual_manifest` were always ignored. As a result, when something was wrong in a virtual manifest, Cargo would unhelpfully exit with no more output than: ``` error: failed to parse manifest at `/tmp/a/Cargo.toml` Caused by: no `package` section found. ``` http://doc.crates.io/manifest.html#virtual-manifest defines a virtual manifest as “the `package` table is not present”, so let’s first determine if a manifest is virtual based on that criteria, and then only call one of the two methods. Although it is not mentioned in the documentation, `[project]` seems to be in the code an alias for `[package]`. So let’s preserve that here too. --- 510cf5eb754ad0fc819796b4dbe9d46cf1db7838