rust/tests/ui/return/tail-expr-as-potential-return.stderr
2023-01-11 09:32:08 +00:00

53 lines
1.5 KiB
Plaintext

error[E0308]: mismatched types
--> $DIR/tail-expr-as-potential-return.rs:27: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:43:9
|
LL | / if true {
LL | | 1i32
| | ^^^^ expected `()`, found `i32`
LL | | //| HELP you might have meant to return this value
LL | | }
| |_____- expected this to be `()`
|
help: you might have meant to return this value
|
LL | return 1i32;
| ++++++ +
error[E0308]: mismatched types
--> $DIR/tail-expr-as-potential-return.rs:19: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 3 previous errors
For more information about this error, try `rustc --explain E0308`.