功能 'xxx' 依赖于 'yyy',这不是可选的依赖项

Feature 'xxx' depends on 'yyy' which is not an optional dependency

我收到这个错误:

error: failed to parse manifest at `...\Cargo.toml`

Caused by:
  Feature `client` depends on `rusttls` which is not an optional dependency.
Consider adding `optional = true` to the dependency

如果我添加 optional = true,它就会消失,但出于安全原因,我不希望 rustls 是可选的。

此错误的确切原因是什么?除了将其设为可选之外,可能的解决方案是什么?

我的 Cargo.toml 有这个:

[features]

default = ["client", "server"]

client = ["serde_json",  "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "rusttls", "tokio-core", "url", "uuid", "multipart"]

server = ["serde_json", "serde-xml-rs", "serde_ignored", "hyper", "hyper-tls", "rusttls", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid", "multipart"]

根据我在 Rust 书上看到的,这样做应该意味着默认情况下客户端和服务器具有这些依赖关系,对吧?

如果依赖项是可选的,则您应该只在功能列表中包含该依赖项。如果依赖项不是可选的,则仅将其包含在 [dependencies] 部分中。