You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments