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

libsyntax: Disallow struct literals after if, while, match, and #14885

Merged
merged 1 commit into from
Jun 24, 2014

Conversation

pcwalton
Copy link
Contributor

for...in.

Closes #14803.

If you used a structure literal after one of these keywords, surround it
in parentheses.

[breaking-change]

r? @nick29581

@alexcrichton
Copy link
Member

Should this update the manual as well?

@huonw huonw mentioned this pull request Jun 16, 2014
@pcwalton
Copy link
Contributor Author

Updated the manual. r? @nick29581

@@ -1 +1 @@
Subproject commit 7b97b8468f0614072cf3299fa8c51e85f609316f
Subproject commit ed112ca1e4275e1c5707a898f2bf6164707ba378
Copy link
Member

Choose a reason for hiding this comment

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

This was reverted by accident I think

@pcwalton
Copy link
Contributor Author

re-r? @alexcrichton

`for...in`.

Closes rust-lang#14803.

If you used a structure literal after one of these keywords, surround it
in parentheses.

[breaking-change]
bors added a commit that referenced this pull request Jun 24, 2014
…xcrichton

`for...in`.

Closes #14803.

If you used a structure literal after one of these keywords, surround it
in parentheses.

[breaking-change]

r? @nick29581
@bors bors closed this Jun 24, 2014
@bors bors merged commit 654d644 into rust-lang:master Jun 24, 2014
@@ -12,7 +12,7 @@ struct Foo;

fn g3() {
let _mid_tuple = (Foo { }, 2);
//~^ ERROR: unit-like struct construction is written with no trailing `{ }`
//~^ ERROR: structure literal must either have at least one field
Copy link

Choose a reason for hiding this comment

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

English - "either ..." or? should perhaps be:
structure literal must have at least one field (removing the 'either')
Same for below changes

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
use `::core` instead of `$crate` in `option_env!`

fix rust-lang#14885
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

Successfully merging this pull request may close these issues.

Tracking issue for disallowing struct literals in ambiguous positions
4 participants