]> git.lizzy.rs Git - rust.git/blob - src/test/ui/liveness/liveness-return-last-stmt-semi.stderr
4255f55a4ec5f658cf7dea56ba1a30b3d54ea8ae
[rust.git] / src / test / ui / liveness / liveness-return-last-stmt-semi.stderr
1 error[E0308]: mismatched types
2   --> $DIR/liveness-return-last-stmt-semi.rs:4:41
3    |
4 LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } }
5    |                                ---      ^^^    - help: consider removing this semicolon
6    |                                |        |
7    |                                |        expected i32, found ()
8    |                                implicitly returns `()` as its body has no tail or `return` expression
9 ...
10 LL |     test!();
11    |     -------- in this macro invocation
12    |
13    = note:   expected type `i32`
14            found unit type `()`
15
16 error[E0308]: mismatched types
17   --> $DIR/liveness-return-last-stmt-semi.rs:7:19
18    |
19 LL | fn no_return() -> i32 {}
20    |    ---------      ^^^ expected i32, found ()
21    |    |
22    |    implicitly returns `()` as its body has no tail or `return` expression
23    |
24    = note:   expected type `i32`
25            found unit type `()`
26
27 error[E0308]: mismatched types
28   --> $DIR/liveness-return-last-stmt-semi.rs:9:19
29    |
30 LL | fn bar(x: u32) -> u32 {
31    |    ---            ^^^ expected u32, found ()
32    |    |
33    |    implicitly returns `()` as its body has no tail or `return` expression
34 LL |     x * 2;
35    |          - help: consider removing this semicolon
36    |
37    = note:   expected type `u32`
38            found unit type `()`
39
40 error[E0308]: mismatched types
41   --> $DIR/liveness-return-last-stmt-semi.rs:13:19
42    |
43 LL | fn baz(x: u64) -> u32 {
44    |    ---            ^^^ expected u32, found ()
45    |    |
46    |    implicitly returns `()` as its body has no tail or `return` expression
47    |
48    = note:   expected type `u32`
49            found unit type `()`
50
51 error: aborting due to 4 previous errors
52
53 For more information about this error, try `rustc --explain E0308`.