-error[E0282]: type annotations needed for the closure `fn() -> std::result::Result<(), QualifiedError<_>>`
- --> $DIR/cannot-infer-partial-try-return.rs:19:9
+error[E0282]: type annotations needed for `Result<(), QualifiedError<_>>`
+ --> $DIR/cannot-infer-partial-try-return.rs:18:13
|
-LL | infallible()?;
- | ^^^^^^^^^^^^^ cannot infer type of error for `?` operator
+LL | let x = || -> Result<_, QualifiedError<_>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `?` implicitly converts the error value into `QualifiedError<_>` using its implementation of `From<Infallible>`
-help: give this closure an explicit return type without `_` placeholders
+help: try giving this closure an explicit return type
|
-LL | let x = || -> std::result::Result<(), QualifiedError<_>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | let x = || -> Result<(), QualifiedError<_>> {
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error