Would support Named Function Parameters?


#1

Could somebody help to give the state of Named Function Parameters feature?

I tested following code and can’t build.

pub fn named(pub a: i32, pub b: i32){
    println!("a={} b={}", a, b);
}

fn main() {
    named(a: 100, b: 200);
}

Playground here.


#2

Found rfcs/issues/323 (postponed) and [Pre-RFC] named arguments, which indicate there’s more discussion to be had. There are people who would like it in Rust, but it isn’t happening soon.

Oh ya, about “the state of things”, I think (at a birds eye view) it roughly goes:

  1. Pre-Pre-RFC (sometimes)
  2. Pre-RFC
  3. RFC
  4. Implementation
  5. Stabilization

and each of those steps is big.