Skip to content
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

Parse multiple consts from a single keyword #3777

Closed
bstrie opened this issue Oct 16, 2012 · 7 comments
Closed

Parse multiple consts from a single keyword #3777

bstrie opened this issue Oct 16, 2012 · 7 comments
Labels
A-grammar Area: The grammar of Rust A-parser Area: The parsing of Rust source code to an AST

Comments

@bstrie
Copy link
Contributor

bstrie commented Oct 16, 2012

This feels like it should work:

const bar: int = 1,  // This should mirror the `let` syntax
      foo: int = 4;

fn main() {
    let baz: int = 0,
        qux: int = 1;
}

But instead you get:

const.rs:1:18: 1:19 error: expected `;` but found `,`
const.rs:1 const bar: int = 1,
                             ^
@sanxiyn
Copy link
Member

sanxiyn commented May 3, 2013

Nominating for backwards compatible milestone.

@pcwalton
Copy link
Contributor

pcwalton commented May 9, 2013

We're considering removing the multiple-let assignment syntax.

@graydon
Copy link
Contributor

graydon commented May 9, 2013

team has some dissent about the desirability of the form altogether, accepting for backwards compatibility since one possible outcome involves removing the let x = 0, y = 1; form entirely.

@nikomatsakis
Copy link
Contributor

One point: I am unhappy with how mut extends to all variables in a single let. Removing multiple variables would address this question as well.

@catamorphism
Copy link
Contributor

I agree with @nikomatsakis 's point about mut. I don't care one way or the other in general, but I think the mut extending-to-all-variables thing is an accident waiting to happen. Removing multiple variables is the simplest solution to that.

@graydon
Copy link
Contributor

graydon commented May 9, 2013

accepted for backwards-compatible milestone

@pcwalton
Copy link
Contributor

Multiple lets are gone so I assume we don't want to do this for static either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: The grammar of Rust A-parser Area: The parsing of Rust source code to an AST
Projects
None yet
Development

No branches or pull requests

6 participants