Closed
Description
Given the following code: (playground)
fn foo(length: &u32) -> i32 {
0
}
fn main() {
let length = 0;
// Expected error:
// length = foo(&length);
// expected `U32`, found `I32`
length = { foo(&length) };
}
The current output is:
error[E0308]: mismatched types
--> src/main.rs:12:16
|
12 | length = { foo(&length) };
| ^^^^^^^^^^^^ expected `U32`, found `I32`
Ideally the output should use the expected name of u32
and i32
.
(This happened to me when using an length = unsafe { ... }
).