Skip to content

Grammar: Add struct expression. #429

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

Merged
merged 2 commits into from
Sep 27, 2018
Merged

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Sep 23, 2018

This includes some rework and expansion of the contents.

This includes some rework and expansion of the contents.
@ehuss ehuss force-pushed the grammar-struct-expr branch from e6b0ca7 to 03048a2 Compare September 23, 2018 20:23

A struct expression with fields enclosed in parentheses constructs a tuple struct. Though
it is listed here as a specific expression for completeness, it is equivalent to a [call
expression] to the tuple struct's constructor. Example:
Copy link
Contributor

Choose a reason for hiding this comment

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

"For example:" please. I'm trying to keep all examples with that exact phrase.


A unit struct expression is just the path to a unit struct item. This refers to the unit
struct's implicit constant of its value. The unit struct value can also be constructed
with fieldless struct expression. Example:
Copy link
Contributor

Choose a reason for hiding this comment

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

"with a"

@Havvy Havvy merged commit 81088ea into rust-lang:master Sep 27, 2018
@Havvy
Copy link
Contributor

Havvy commented Sep 27, 2018

💟 Thanks!

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.

2 participants