summaryrefslogtreecommitdiffstats
path: root/tests/ui/inference/issue-86094-suggest-add-return-to-coerce-ret-ty.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /tests/ui/inference/issue-86094-suggest-add-return-to-coerce-ret-ty.stderr
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/inference/issue-86094-suggest-add-return-to-coerce-ret-ty.stderr')
-rw-r--r--tests/ui/inference/issue-86094-suggest-add-return-to-coerce-ret-ty.stderr98
1 files changed, 98 insertions, 0 deletions
diff --git a/tests/ui/inference/issue-86094-suggest-add-return-to-coerce-ret-ty.stderr b/tests/ui/inference/issue-86094-suggest-add-return-to-coerce-ret-ty.stderr
new file mode 100644
index 000000000..1fea73529
--- /dev/null
+++ b/tests/ui/inference/issue-86094-suggest-add-return-to-coerce-ret-ty.stderr
@@ -0,0 +1,98 @@
+error[E0282]: type annotations needed
+ --> $DIR/issue-86094-suggest-add-return-to-coerce-ret-ty.rs:5:9
+ |
+LL | Err(MyError);
+ | ^^^ cannot infer type of the type parameter `T` declared on the enum `Result`
+ |
+help: consider specifying the generic arguments
+ |
+LL | Err::<T, MyError>(MyError);
+ | ++++++++++++++
+help: you might have meant to return this to infer its type parameters
+ |
+LL | return Err(MyError);
+ | ++++++
+
+error[E0282]: type annotations needed
+ --> $DIR/issue-86094-suggest-add-return-to-coerce-ret-ty.rs:14:9
+ |
+LL | Ok(());
+ | ^^ cannot infer type of the type parameter `E` declared on the enum `Result`
+ |
+help: consider specifying the generic arguments
+ |
+LL | Ok::<(), E>(());
+ | +++++++++
+help: you might have meant to return this to infer its type parameters
+ |
+LL | return Ok(());
+ | ++++++
+
+error[E0308]: mismatched types
+ --> $DIR/issue-86094-suggest-add-return-to-coerce-ret-ty.rs:21:20
+ |
+LL | fn baz(x: bool) -> Result<(), MyError> {
+ | --- ^^^^^^^^^^^^^^^^^^^ expected `Result<(), MyError>`, found `()`
+ | |
+ | implicitly returns `()` as its body has no tail or `return` expression
+...
+LL | Err(MyError);
+ | - help: remove this semicolon to return this value
+ |
+ = note: expected enum `Result<(), MyError>`
+ found unit type `()`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-86094-suggest-add-return-to-coerce-ret-ty.rs:35:10
+ |
+LL | if x {
+ | __________^
+LL | |
+LL | | error();
+ | | - help: remove this semicolon to return this value
+LL | | } else {
+ | |_____^ expected `Result<(), MyError>`, found `()`
+ |
+ = note: expected enum `Result<(), MyError>`
+ found unit type `()`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-86094-suggest-add-return-to-coerce-ret-ty.rs:38:12
+ |
+LL | } else {
+ | ____________^
+LL | |
+LL | | error();
+ | | - help: remove this semicolon to return this value
+LL | | }
+ | |_____^ expected `Result<(), MyError>`, found `()`
+ |
+ = note: expected enum `Result<(), MyError>`
+ found unit type `()`
+
+error[E0282]: type annotations needed
+ --> $DIR/issue-86094-suggest-add-return-to-coerce-ret-ty.rs:45:5
+ |
+LL | Err(MyError);
+ | ^^^ cannot infer type of the type parameter `T` declared on the enum `Result`
+ |
+help: consider specifying the generic arguments
+ |
+LL | Err::<T, MyError>(MyError);
+ | ++++++++++++++
+
+error[E0282]: type annotations needed
+ --> $DIR/issue-86094-suggest-add-return-to-coerce-ret-ty.rs:57:27
+ |
+LL | with_closure(|x: u32, y| {});
+ | ^
+ |
+help: consider giving this closure parameter an explicit type
+ |
+LL | with_closure(|x: u32, y: /* Type */| {});
+ | ++++++++++++
+
+error: aborting due to 7 previous errors
+
+Some errors have detailed explanations: E0282, E0308.
+For more information about an error, try `rustc --explain E0282`.