Closed
Description
Given the following code:
fn uwu(val: i32) {}
fn main() {
let x = 1_i32;
uwu(val: x);
}
The current output is:
error[E0425]: cannot find value `val` in this scope
--> src/main.rs:5:9
|
5 | uwu(val: x);
| ^^^ expecting a type here because of type ascription
error[E0573]: expected type, found local variable `x`
--> src/main.rs:5:14
|
5 | uwu(val: x);
| ^ expecting a type here because of type ascription
Ideally the output should look like it does when value
is a literal, like an integer, float, or string literal
error: invalid `struct` delimiters or `fn` call arguments
--> src/main.rs:5:5
|
5 | uwu(val: x);
| ^^^^^^^^^^^^^^^
|
help: if `uwu` is a struct, use braces as delimiters
|
5 | uwu { val: x };
| ~ ~
help: if `uwu` is a function, use the arguments directly
|
5 - uwu(val: x);
5 + uwu(x);
|
Diagnostics reproduce on all of current stable, beta, and nightly:
Stable 1.66.0
Beta 1.67.0-beta.2
Nightly 1.68.0 2022-12-15