summaryrefslogtreecommitdiffstats
path: root/tests/ui/generator/type-mismatch-signature-deduction.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generator/type-mismatch-signature-deduction.stderr')
-rw-r--r--tests/ui/generator/type-mismatch-signature-deduction.stderr33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/ui/generator/type-mismatch-signature-deduction.stderr b/tests/ui/generator/type-mismatch-signature-deduction.stderr
new file mode 100644
index 000000000..b98da1ed8
--- /dev/null
+++ b/tests/ui/generator/type-mismatch-signature-deduction.stderr
@@ -0,0 +1,33 @@
+error[E0308]: mismatched types
+ --> $DIR/type-mismatch-signature-deduction.rs:14:9
+ |
+LL | 5
+ | ^ expected enum `Result`, found integer
+ |
+ = note: expected enum `Result<{integer}, _>`
+ found type `{integer}`
+note: return type inferred to be `Result<{integer}, _>` here
+ --> $DIR/type-mismatch-signature-deduction.rs:9:20
+ |
+LL | return Ok(6);
+ | ^^^^^
+help: try wrapping the expression in a variant of `Result`
+ |
+LL | Ok(5)
+ | +++ +
+LL | Err(5)
+ | ++++ +
+
+error[E0271]: type mismatch resolving `<[generator@$DIR/type-mismatch-signature-deduction.rs:7:5: 7:7] as Generator>::Return == i32`
+ --> $DIR/type-mismatch-signature-deduction.rs:5:13
+ |
+LL | fn foo() -> impl Generator<Return = i32> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `i32`
+ |
+ = note: expected enum `Result<{integer}, _>`
+ found type `i32`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0271, E0308.
+For more information about an error, try `rustc --explain E0271`.