]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/inference/cannot-infer-partial-try-return.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / inference / cannot-infer-partial-try-return.stderr
index a64503fa667c73f5ff7d88c021753bcb7d222269..220602c124cb15a47f41c261f570008285fa26f4 100644 (file)
@@ -1,14 +1,13 @@
-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