]> git.lizzy.rs Git - rust.git/blob - src/test/ui/liveness/liveness-return-last-stmt-semi.stderr
Rollup merge of #86165 - m-ou-se:proc-macro-span-shrink, r=dtolnay
[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:7:19
3    |
4 LL | fn no_return() -> i32 {}
5    |    ---------      ^^^ expected `i32`, found `()`
6    |    |
7    |    implicitly returns `()` as its body has no tail or `return` expression
8
9 error[E0308]: mismatched types
10   --> $DIR/liveness-return-last-stmt-semi.rs:9:19
11    |
12 LL | fn bar(x: u32) -> u32 {
13    |    ---            ^^^ expected `u32`, found `()`
14    |    |
15    |    implicitly returns `()` as its body has no tail or `return` expression
16 LL |     x * 2;
17    |          - help: consider removing this semicolon
18
19 error[E0308]: mismatched types
20   --> $DIR/liveness-return-last-stmt-semi.rs:13:19
21    |
22 LL | fn baz(x: u64) -> u32 {
23    |    ---            ^^^ expected `u32`, found `()`
24    |    |
25    |    implicitly returns `()` as its body has no tail or `return` expression
26
27 error[E0308]: mismatched types
28   --> $DIR/liveness-return-last-stmt-semi.rs:4:41
29    |
30 LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } }
31    |                                ---      ^^^    - help: consider removing this semicolon
32    |                                |        |
33    |                                |        expected `i32`, found `()`
34    |                                implicitly returns `()` as its body has no tail or `return` expression
35 ...
36 LL |     test!();
37    |     -------- in this macro invocation
38    |
39    = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
40
41 error: aborting due to 4 previous errors
42
43 For more information about this error, try `rustc --explain E0308`.