Pretend for a moment that Rust functions only ever take single arguments (besides self).
Consider that the current positional syntax is equivalent to passing an unnamed tuple to your function, and is, in fact, sugar for exactly that…e.g. the function:
fn my_func(a:i32:b:u64,c:&str) {};
can be called as:
my_funct(1,2,"foo");
but this is really shorthand for:
let a=(1:i32,2:u64,"foo":&str);
my_func(a);
or, if done anonymously
my_func((1:i32,2:u64,"foo":&str));
So the current behavior is nothing more than parentheses elision for anonymous tuples
Unless I’m missing something, this re-imagining of existing function arguments would then be fully backwards compatible
Given the RFC for anonymous structs, then, supporting them as arguments would be perfectly parallel
fn my_func({a:i32,b:u64,c:&str}) {}
could be called as:
my_funct({a:1,b:2,c:"foo"});
or if brace elision is allowed:
my_func(a:1,b:2,c:"foo");
or explicitly
let my_val = {a:1i32,b:2u64,c:"foo"};
my_func(my_val);
or if positional support is also allowed:
my_func(1,2,"foo");
This would unify fn arguments, tuples, and structs, and allow for any expansion of structs to enable default arguments to apply here as well.
Assuming there is not fatal flaw with the above, I’d probably prefer that named parameters fns not automatically also support positional call syntax, but if desired could be #derived with an annotation
TL;DR
by re-imaging all function arguments as unnamed tuples, unnamed structs can be perfectly ergonomic as named arguments.