]> git.lizzy.rs Git - rust.git/blob - tests/ui/liveness/liveness-return-last-stmt-semi.stderr
Don't resolve type var roots in point_at_expr_source_of_inferred_type
[rust.git] / tests / ui / liveness / liveness-return-last-stmt-semi.stderr
1 error[E0308]: mismatched types
2   --> $DIR/liveness-return-last-stmt-semi.rs:6: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:8: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: remove this semicolon to return this value
18
19 error[E0308]: mismatched types
20   --> $DIR/liveness-return-last-stmt-semi.rs:12: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:3:41
29    |
30 LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } }
31    |                                ---      ^^^ expected `i32`, found `()`
32    |                                |
33    |                                implicitly returns `()` as its body has no tail or `return` expression
34 ...
35 LL |     test!();
36    |     ------- in this macro invocation
37    |
38    = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
39
40 error: aborting due to 4 previous errors
41
42 For more information about this error, try `rustc --explain E0308`.