summaryrefslogtreecommitdiffstats
path: root/src/test/ui/return/tail-expr-as-potential-return.stderr
blob: dec1cbc4624ef5bece1d9262d612b21663ccb1e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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`.