Compiling serde_dhall v0.9.0 (https://github.com/Nadrieril/dhall-rust.git?branch=master#1397a53d)
error[E0283]: type annotations needed
--> .cargo/git/checkouts/dhall-rust-d64922cbec5ad46e/1397a53/serde_dhall/src/deserialize.rs:141:42
|
141 | m.iter().map(|(k, v)| (k.as_ref(), val(v))),
| --^^^^^^--
| | |
| | cannot infer type for type parameter `T` declared on the trait `AsRef`
| this method call resolves to `&T`
|
= note: cannot satisfy `std::string::String: AsRef<_>
Sometimes just having extra traits in existence can break type inference. I think that here another crate is implementing AsRef<{some other type}> for String and so Rust can no longer infer that all .as_ref()s on a string will use the AsRef<str> implementation.
Sometimes just having extra traits in existence can break type inference. I think that here another crate is implementing
AsRef<{some other type}>
forString
and so Rust can no longer infer that all.as_ref()
s on a string will use theAsRef<str>
implementation.