首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Cargo无法解析url版本0.5.7的Cargo.toml

Cargo无法解析url版本0.5.7的Cargo.toml
EN

Stack Overflow用户
提问于 2017-08-03 17:12:45
回答 1查看 1.2K关注 0票数 3

我在运行cargo build时遇到一个问题

代码语言:javascript
复制
/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

我在GitHub上找到了这个issue,但它没有解决我的问题。

这是我的项目Cargo.toml

代码语言:javascript
复制
[dependencies]
hyper = "0.7.2"
rustc-serialize = "0.3"
websocket = "0.15.1"

以及我的rustccargo版本:

代码语言:javascript
复制
➜  ~ cargo -V
cargo 0.18.0 (fe7b0cdcf 2017-04-24)
➜  ~ rustc -V
rustc 1.17.0 (56124baa9 2017-04-24)

下面是Cargo抱怨的文件(/home/lzc/.multirust/toolchains/stable/cargo/registry/src/github.com-1ecc6299db9ec823/url-0.5.7/Cargo.toml):

代码语言:javascript
复制
[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"
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-03 21:45:23

正如url crate's GitHub issue中所列出的,它以前使用的一种形式的TOML实际上是无效的。较新版本的Cargo不再解析该无效形式。

显示的依赖项列表中没有任何内容需要0.5.7版的url。url版本0.5.10已发布,请执行cargo update切换到该版本。请注意,0.5.10是在2016年8月21日发布的,所以在这一点上它几乎已经发布了一年。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45479799

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档