Skip to content

Names of function types shouldn't allow parameter names #731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brson opened this issue Jul 24, 2011 · 7 comments
Closed

Names of function types shouldn't allow parameter names #731

brson opened this issue Jul 24, 2011 · 7 comments

Comments

@brson
Copy link
Contributor

brson commented Jul 24, 2011

let fn(int x) a = f is a valid declaration but the x is useless.

@marijnh
Copy link
Contributor

marijnh commented Jul 24, 2011

I think this is intentional -- you can optionally include them, as documentation, but don't have to.

@eholk
Copy link
Contributor

eholk commented Jul 25, 2011

I think they might be required for right now... at least, I seem to recall having problems with leaving them out before.

@marijnh
Copy link
Contributor

marijnh commented Jul 25, 2011

I'm pretty sure they are optional currently. See https://github.com/graydon/rust/blob/master/src/comp/syntax/parse/parser.rs#L256

@eholk
Copy link
Contributor

eholk commented Jul 25, 2011

At least in native modules, this doesn't seem to work. I'm trying to make this compile:

native "rust" mod rustrt {
    fn set_min_stack(uint);
}

It fails with "error: expecting ident."

@marijnh
Copy link
Contributor

marijnh commented Jul 26, 2011

Ah, that's a native function item, not a type. Yes, they seem to be required there. I think Graydon considered them desirable for documentation there. I actually agree it seems sane to require them.

@msullivan
Copy link
Contributor

Yeah, I vote for keeping them allowed.

@msullivan
Copy link
Contributor

I think consensus is WONTFIX.

pdietl pushed a commit to pdietl/rust that referenced this issue Apr 23, 2020
Added clearification that closures are refered to lambdas
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
* Fix vector/scalar analysis

* add test

* fix test

* no clang format
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants