summaryrefslogtreecommitdiffstats
path: root/src/test/ui/return/tail-expr-as-potential-return.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/return/tail-expr-as-potential-return.stderr')
-rw-r--r--src/test/ui/return/tail-expr-as-potential-return.stderr37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/test/ui/return/tail-expr-as-potential-return.stderr b/src/test/ui/return/tail-expr-as-potential-return.stderr
new file mode 100644
index 000000000..dec1cbc46
--- /dev/null
+++ b/src/test/ui/return/tail-expr-as-potential-return.stderr
@@ -0,0 +1,37 @@
+error[E0308]: mismatched types
+ --> $DIR/tail-expr-as-potential-return.rs:28:9
+ |
+LL | / if x {
+LL | | Err(42)
+ | | ^^^^^^^ expected `()`, found enum `Result`
+LL | | //| HELP you might have meant to return this value
+LL | | }
+ | |_____- expected this to be `()`
+ |
+ = note: expected unit type `()`
+ found enum `Result<_, {integer}>`
+help: you might have meant to return this value
+ |
+LL | return Err(42);
+ | ++++++ +
+
+error[E0308]: mismatched types
+ --> $DIR/tail-expr-as-potential-return.rs:20:9
+ |
+LL | / if x {
+LL | | Err(42)
+ | | ^^^^^^^ expected `()`, found enum `Result`
+LL | | //| HELP you might have meant to return this value
+LL | | }
+ | |_____- expected this to be `()`
+ |
+ = note: expected unit type `()`
+ found enum `Result<_, {integer}>`
+help: you might have meant to return this value
+ |
+LL | return Err(42);
+ | ++++++ +
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.