mirror of https://github.com/rust-lang/reference
Address review comments w.r.t. remove enum variant expr
This commit is contained in:
parent
d8cbe4eedb
commit
4471b0efbc
|
@ -6,3 +6,6 @@ author = "The Rust Project Developers"
|
||||||
[output.html]
|
[output.html]
|
||||||
additional-css = ["theme/reference.css"]
|
additional-css = ["theme/reference.css"]
|
||||||
git-repository-url = "https://github.com/rust-lang/reference/"
|
git-repository-url = "https://github.com/rust-lang/reference/"
|
||||||
|
|
||||||
|
[output.html.redirect]
|
||||||
|
"/expressions/enum-variant-expr.html" = "struct-expr.html"
|
|
@ -28,7 +28,7 @@
|
||||||
> _StructExprUnit_ : [_PathInExpression_]
|
> _StructExprUnit_ : [_PathInExpression_]
|
||||||
|
|
||||||
A *struct expression* creates a struct, enum, or union value.
|
A *struct expression* creates a struct, enum, or union value.
|
||||||
It consists of a path to a [struct], [enum], or [union] item followed by the values for the fields of the item.
|
It consists of a path to a [struct], [enum variant], or [union] item followed by the values for the fields of the item.
|
||||||
There are three forms of struct expressions: struct, tuple, and unit.
|
There are three forms of struct expressions: struct, tuple, and unit.
|
||||||
|
|
||||||
The following are examples of struct expressions:
|
The following are examples of struct expressions:
|
||||||
|
@ -101,8 +101,7 @@ Point3d { x, y: y_value, z };
|
||||||
## Tuple struct expression
|
## Tuple struct expression
|
||||||
|
|
||||||
A struct expression with fields enclosed in parentheses constructs a tuple struct.
|
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. For example: <!--
|
Though it is listed here as a specific expression for completeness, it is equivalent to a [call expression] to the tuple struct's constructor. For example:
|
||||||
This is false. Example: Position(0, ..other_position) -->
|
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
struct Position(i32, i32, i32);
|
struct Position(i32, i32, i32);
|
||||||
|
@ -135,7 +134,7 @@ let b = Gamma{}; // Exact same value as `a`.
|
||||||
[_PathInExpression_]: ../paths.md#paths-in-expressions
|
[_PathInExpression_]: ../paths.md#paths-in-expressions
|
||||||
[attributes on block expressions]: block-expr.md#attributes-on-block-expressions
|
[attributes on block expressions]: block-expr.md#attributes-on-block-expressions
|
||||||
[call expression]: call-expr.md
|
[call expression]: call-expr.md
|
||||||
[enum]: ../items/enumerations.md
|
[enum variant]: ../items/enumerations.md
|
||||||
[if let]: if-expr.md#if-let-expressions
|
[if let]: if-expr.md#if-let-expressions
|
||||||
[if]: if-expr.md#if-expressions
|
[if]: if-expr.md#if-expressions
|
||||||
[loop]: loop-expr.md
|
[loop]: loop-expr.md
|
||||||
|
|
Loading…
Reference in New Issue