【发布时间】:2016-09-07 12:12:07
【问题描述】:
为了试验 Hyper,我从 the GET example 开始。除了示例无法编译(no method `get` in `client`)这一事实之外,我将我的问题提炼为一行:
fn temp() {
let client = Client::new();
}
此代码无法编译:
unable to infer enough type information about `_`; type annotations or generic parameter binding required [E0282]
【问题讨论】:
-
我自己试过了,但无法重现错误。您的文件中有
extern crate hyper;和use hyper::Client;吗?这是我的工作版本:play.integer32.com/?gist=4debd4812508baf255f21715fbf44ef0 -
将您的代码粘贴到我的 main.rs 中。同样的错误
-
好的。当我使用 rust-lang repo 中的 hyper 时,它会编译,当我使用 hyper repo 中的 hyper={git = "github.com/hyperium/hyper"} 时,它不会编译。这也许可以解释为什么......
标签: rust type-inference hyper