-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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 { ... }
).
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.