Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message for invalid Cargo.toml file #1011

Closed
SimonSapin opened this issue Dec 4, 2014 · 3 comments
Closed

Confusing error message for invalid Cargo.toml file #1011

SimonSapin opened this issue Dec 4, 2014 · 3 comments
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself.

Comments

@SimonSapin
Copy link
Contributor

This Cargo.toml file:

[package]

name = "matches"
version = "0.0.1"
authors = ["Simon Sapin <[email protected]>"]

[lib]
path = "lib.rs"

Gives a confusing error message:

matches/Cargo.toml is not a valid manifest

expected a value of type `array`, but found a value of type `table` for the key `lib`

Adding a lib.name key fixes it, but the error message was not helpful in finding that out.

[package]

name = "matches"
version = "0.0.1"
authors = ["Simon Sapin <[email protected]>"]

[lib]
name = "matches"
path = "lib.rs"

Also, since omitting the [lib] section entirely works, overriding just lib.path should work as well, keeping the default name.

@toh-ableton
Copy link

Just ran into this as well. I appears that the bug is that you need more than one key-value pair in the [lib]-section.

@alexcrichton alexcrichton added the A-diagnostics Area: Error and warning messages generated by Cargo itself. label Jan 14, 2015
@oli-obk
Copy link
Contributor

oli-obk commented May 5, 2015

I think this is fixed. The error is now expected a value of type stringfor the keylib.name``

@alexcrichton
Copy link
Member

Thanks @oli-obk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself.
Projects
None yet
Development

No branches or pull requests

4 participants