You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the conservative_impl_trait feature to elide some otherwise gnarly return types in my program. It can compile fine, but then when I try to generate documentation, rustdoc errors saying it can't figure out the return type and type annotations are required.
Wouldn't cargo and rustdoc both use the same rustc under the hood? I don't see why the compiler would be able to figure out the return type, but can't when we try to generate docs.
For a bit of context on the return type, I'm actually fetching a cursor from my database (which may fail), then map-ping through them trying to deserialize the results into some T.
error[E0282]: type annotations needed
--> src/db.rs:78:17
|
78 | ) -> Result<impl Iterator<Item = Result<T>>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for `_`
error: Compilation failed, aborting rustdoc
I'm using the
conservative_impl_trait
feature to elide some otherwise gnarly return types in my program. It can compile fine, but then when I try to generate documentation, rustdoc errors saying it can't figure out the return type and type annotations are required.Wouldn't
cargo
andrustdoc
both use the samerustc
under the hood? I don't see why the compiler would be able to figure out the return type, but can't when we try to generate docs.The code in question:
For a bit of context on the return type, I'm actually fetching a cursor from my database (which may fail), then
map
-ping through them trying to deserialize the results into someT
.This happens on the latest nightly.
The text was updated successfully, but these errors were encountered: