]> git.lizzy.rs Git - rust.git/blob - tests/ui/return/tail-expr-as-potential-return.stderr
Rollup merge of #107486 - compiler-errors:bound-ty-keep-name, r=oli-obk
[rust.git] / tests / ui / return / tail-expr-as-potential-return.stderr
1 error[E0308]: mismatched types
2   --> $DIR/tail-expr-as-potential-return.rs:27:9
3    |
4 LL | /     if x {
5 LL | |         Err(42)
6    | |         ^^^^^^^ expected `()`, found `Result<_, {integer}>`
7 LL | |                 //| HELP you might have meant to return this value
8 LL | |     }
9    | |_____- expected this to be `()`
10    |
11    = note: expected unit type `()`
12                    found enum `Result<_, {integer}>`
13 help: you might have meant to return this value
14    |
15 LL |         return Err(42);
16    |         ++++++        +
17
18 error[E0308]: mismatched types
19   --> $DIR/tail-expr-as-potential-return.rs:43:9
20    |
21 LL | /     if true {
22 LL | |         1i32
23    | |         ^^^^ expected `()`, found `i32`
24 LL | |             //| HELP you might have meant to return this value
25 LL | |     }
26    | |_____- expected this to be `()`
27    |
28 help: you might have meant to return this value
29    |
30 LL |         return 1i32;
31    |         ++++++     +
32
33 error[E0308]: mismatched types
34   --> $DIR/tail-expr-as-potential-return.rs:19:9
35    |
36 LL | /     if x {
37 LL | |         Err(42)
38    | |         ^^^^^^^ expected `()`, found `Result<_, {integer}>`
39 LL | |                 //| HELP you might have meant to return this value
40 LL | |     }
41    | |_____- expected this to be `()`
42    |
43    = note: expected unit type `()`
44                    found enum `Result<_, {integer}>`
45 help: you might have meant to return this value
46    |
47 LL |         return Err(42);
48    |         ++++++        +
49
50 error: aborting due to 3 previous errors
51
52 For more information about this error, try `rustc --explain E0308`.