Cargo cannot parse Cargo.toml for url version 0.5.7

I got a problem when starting cargo build

:

/usr/local/bin/cargo build --color=always
error: unable to get packages from source

Caused by:
failed to parse manifest at `/home/lzc/.multirust/toolchains/stable/cargo/registry/src/github.com-1ecc6299db9ec823/url-0.5.7/Cargo.toml`

Caused by:
could not parse input as TOML

Caused by:
expected newline, found an identifier at line 14

      

I found this issue on GitHub, but it didn't solve my problem.

This is my project Cargo.toml

:

[dependencies]
hyper = "0.7.2"
rustc-serialize = "0.3"
websocket = "0.15.1"

      

And my versions rustc

and cargo

:

➜  ~ cargo -V
cargo 0.18.0 (fe7b0cdcf 2017-04-24)
➜  ~ rustc -V
rustc 1.17.0 (56124baa9 2017-04-24)

      

And here is the Cargo file complaining ( /home/lzc/.multirust/toolchains/stable/cargo/registry/src/github.com-1ecc6299db9ec823/url-0.5.7/Cargo.toml

):

[package]

name = "url"
version = "0.5.7"
authors = [ "Simon Sapin <simon.sapin@exyr.org>" ]

description = "URL library for Rust, based on the WHATWG URL Standard"
documentation = "http://servo.github.io/rust-url/url/index.html"
repository = "https://github.com/servo/rust-url"
readme = "README.md"
keywords = ["url", "parser"]
license = "MIT/Apache-2.0"

[[test]] name = "format"                #<- line 14
[[test]] name = "form_urlencoded"
[[test]] name = "idna"
[[test]] name = "punycode"
[[test]] name = "tests"
[[test]]
name = "wpt"
harness = false

[dev-dependencies]
rustc-test = "0.1"

[features]
query_encoding = ["encoding"]
serde_serialization = ["serde"]
heap_size = ["heapsize", "heapsize_plugin"]

[dependencies.heapsize]
version = ">=0.1.1, <0.4"
optional = true

[dependencies.heapsize_plugin]
version = "0.1.0"
optional = true

[dependencies.encoding]
version = "0.2"
optional = true

[dependencies.serde]
version = ">=0.6.1, <0.8"
optional = true

[dependencies]
uuid = "0.1.17"
rustc-serialize = "0.3"
unicode-bidi = "0.2.3"
unicode-normalization = "0.1.2"
matches = "0.1"

      

+3


source to share


1 answer


As pointed out in GitHub url issues, the TOML form was previously used which was actually invalid. Newer versions of Cargo no longer parse this invalid form.



Nothing in the list of displayed dependencies is required for version 0.5.7. url version 0.5.10 has been released, so to switch to it run cargo update

. Note that 0.5.10 was published on Aug 21, 2016, so almost a year ago at this stage.

+2


source







All Articles