Update error message with more details.

This resolves #1379.
This commit is contained in:
Stephen Becker IV 2015-05-16 12:39:48 -07:00
parent a48358155c
commit 649625d707
3 changed files with 4 additions and 4 deletions

View file

@ -118,8 +118,8 @@ pub fn to_manifest(contents: &[u8],
None => {}
}
if !manifest.targets().iter().any(|t| !t.is_custom_build()) {
return Err(human(format!("either a [lib] or [[bin]] section must \
be present")))
return Err(human(format!("either a [lib] (lib.rs) or [[bin]] (main.rs) section must \
be present in src")))
}
return Ok((manifest, paths));

View file

@ -794,7 +794,7 @@ test!(missing_lib_and_bin {
failed to parse manifest at `[..]Cargo.toml`
Caused by:
either a [lib] or [[bin]] section must be present\n"));
either a [lib] (lib.rs) or [[bin]] (main.rs) section must be present in src\n"));
});
test!(lto_build {

View file

@ -953,7 +953,7 @@ test!(build_script_only {
failed to parse manifest at `[..]`
Caused by:
either a [lib] or [[bin]] section must be present"));
either a [lib] (lib.rs) or [[bin]] (main.rs) section must be present in src"));
});
test!(shared_dep_with_a_build_script {