[rust-dev] names needed for function types

Niko Matsakis niko at alum.mit.edu
Sun Jan 1 09:37:26 PST 2012


> Here is how it would look with square brackets:

It occurs to me that the "capture clause" could (and probably should) go 
before the name, if we allowed it on nested fn item declarations:

     fn no_env(a: A, b: B) {...}
     fn<copy> boxed_env_1(a: A, b: B) {...}
     fn<copy a; move b> boxed_env_2<A,B>(a: A, b: B) {...}
     fn<send; copy a; move b> unique_env<A,B>(a: A, b: B) {...}

In this way there is no ambiguity at all.  (Note that we don't allow 
function types to have generic parameters at the moment)


Niko


More information about the Rust-dev mailing list