Skip to content

Disallow trailing parentheses for nullary enum variants - #12935

Merged
bors merged 1 commit into
rust-lang:masterfrom
lbonn:nullenum
Mar 17, 2014
Merged

Disallow trailing parentheses for nullary enum variants#12935
bors merged 1 commit into
rust-lang:masterfrom
lbonn:nullenum

Conversation

@lbonn

Copy link
Copy Markdown
Contributor

Fix for #12560

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using error-pattern, you should be using //~ ERROR nullary enum variants ...

This will check that the line numbers are correct, not just that the error was printed.

@lbonn

Copy link
Copy Markdown
ContributorAuthor

Thanks for the tip, here is a new diff.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests would either be written as

enumFoo{Bar(),Baz()}//~ ERROR nullary enum variants//~^ ERROR nullary enum variants

or, preferably (to keep the error as precise as possible)

enumFoo{Bar(),//~ ERROR nullary enum variantsBaz()//~ ERROR nullary enum variants}

and similarly below.

@lbonn

Copy link
Copy Markdown
ContributorAuthor

Sorry for the mix-up, here is another update.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what other folks think about this but I prefer having the full error message here. There are error messages that share the same prefix (not the case of this PR... I think). Also, the full error message helps understanding what the test is actually testing.

@lbonn

Copy link
Copy Markdown
ContributorAuthor

Ok, I pushed more documented test cases.

bors added a commit that referenced this pull request Mar 17, 2014
@borsbors closed this Mar 17, 2014
@bors
bors merged commit 695114e into rust-lang:masterMar 17, 2014
Kroisse added a commit to Kroisse/rust-mustache that referenced this pull request Mar 22, 2014
related issues of mozilla/rust:
- rust-lang/rust#12772 rename std::vec -> std::slice
- rust-lang/rust#13028 rename std::vec_ng -> std::vec
- rust-lang/rust@0305ed5 std: Add Vec to the prelude
- rust-lang/rust#12935 Disallow trailing parentheses for nullary enum variants
lnicola pushed a commit to lnicola/rust that referenced this pull request Aug 16, 2022
…r=Veykril
Parse range patterns in struct and slice without trailing comma
Resolvesrust-lang#12935
This patch includes the support for range patterns in slices, which is unstable (tracked in rust-lang#67264). If it's not desired I can remove it.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@lbonn@flaper87@alexcrichton@emberian@huonw@bors