@@ -1178,22 +1178,11 @@ let px: i32 = match p { Point(x, _) => x };
1178
1178
```
1179
1179
1180
1180
A _ unit-like struct_ is a structure without any fields, defined by leaving off
1181
- the list of fields entirely. Such a structure implicitly defines a constant of
1182
- its type with the same name. For example:
1181
+ the list of fields entirely. Such types will have a single value. For example:
1183
1182
1184
1183
```
1185
- # #![feature(braced_empty_structs)]
1186
1184
struct Cookie;
1187
- let c = [Cookie, Cookie {}, Cookie, Cookie {}];
1188
- ```
1189
-
1190
- is equivalent to
1191
-
1192
- ```
1193
- # #![feature(braced_empty_structs)]
1194
- struct Cookie {}
1195
- const Cookie: Cookie = Cookie {};
1196
- let c = [Cookie, Cookie {}, Cookie, Cookie {}];
1185
+ let c = [Cookie, Cookie, Cookie, Cookie];
1197
1186
```
1198
1187
1199
1188
The precise memory layout of a structure is not specified. One can specify a
@@ -2422,7 +2411,6 @@ The currently implemented features of the reference compiler are:
2422
2411
terms of encapsulation).
2423
2412
* - ` default_type_parameter_fallback ` - Allows type parameter defaults to
2424
2413
influence type inference.
2425
- * - ` braced_empty_structs ` - Allows use of empty structs with braces.
2426
2414
2427
2415
If a feature is promoted to a language feature, then all existing programs will
2428
2416
start to receive compilation warnings about ` #![feature] ` directives which enabled
@@ -2774,7 +2762,7 @@ The following expressions are equivalent.
2774
2762
let x = std::ops::Range {start: 0, end: 10};
2775
2763
let y = 0..10;
2776
2764
2777
- assert_eq!(x, y);
2765
+ assert_eq!(x,y);
2778
2766
```
2779
2767
2780
2768
### Unary operator expressions
@@ -3047,18 +3035,18 @@ A `loop` expression may optionally have a _label_. The label is written as
3047
3035
a lifetime preceding the loop expression, as in ` 'foo: loop{ } ` . If a
3048
3036
label is present, then labeled ` break ` and ` continue ` expressions nested
3049
3037
within this loop may exit out of this loop or return control to its head.
3050
- See [ break expressions] ( #break-expressions ) and [ continue
3038
+ See [ Break expressions] ( #break-expressions ) and [ Continue
3051
3039
expressions] ( #continue-expressions ) .
3052
3040
3053
- ### ` break ` expressions
3041
+ ### Break expressions
3054
3042
3055
3043
A ` break ` expression has an optional _ label_ . If the label is absent, then
3056
3044
executing a ` break ` expression immediately terminates the innermost loop
3057
3045
enclosing it. It is only permitted in the body of a loop. If the label is
3058
3046
present, then ` break 'foo ` terminates the loop with label ` 'foo ` , which need not
3059
3047
be the innermost label enclosing the ` break ` expression, but must enclose it.
3060
3048
3061
- ### ` continue ` expressions
3049
+ ### Continue expressions
3062
3050
3063
3051
A ` continue ` expression has an optional _ label_ . If the label is absent, then
3064
3052
executing a ` continue ` expression immediately terminates the current iteration
@@ -3071,7 +3059,7 @@ innermost label enclosing the `break` expression, but must enclose it.
3071
3059
3072
3060
A ` continue ` expression is only permitted in the body of a loop.
3073
3061
3074
- ### ` while ` loops
3062
+ ### While loops
3075
3063
3076
3064
A ` while ` loop begins by evaluating the boolean loop conditional expression.
3077
3065
If the loop conditional expression evaluates to ` true ` , the loop body block
@@ -3094,12 +3082,12 @@ Like `loop` expressions, `while` loops can be controlled with `break` or
3094
3082
loops] ( #infinite-loops ) , [ break expressions] ( #break-expressions ) , and
3095
3083
[ continue expressions] ( #continue-expressions ) for more information.
3096
3084
3097
- ### ` for ` expressions
3085
+ ### For expressions
3098
3086
3099
3087
A ` for ` expression is a syntactic construct for looping over elements provided
3100
3088
by an implementation of ` std::iter::IntoIterator ` .
3101
3089
3102
- An example of a ` for ` loop over the contents of an array:
3090
+ An example of a for loop over the contents of an array:
3103
3091
3104
3092
```
3105
3093
# type Foo = i32;
@@ -3129,7 +3117,7 @@ Like `loop` expressions, `for` loops can be controlled with `break` or
3129
3117
loops] ( #infinite-loops ) , [ break expressions] ( #break-expressions ) , and
3130
3118
[ continue expressions] ( #continue-expressions ) for more information.
3131
3119
3132
- ### ` if ` expressions
3120
+ ### If expressions
3133
3121
3134
3122
An ` if ` expression is a conditional branch in program control. The form of an
3135
3123
` if ` expression is a condition expression, followed by a consequent block, any
@@ -3141,7 +3129,7 @@ evaluates to `false`, the consequent block is skipped and any subsequent `else
3141
3129
if` condition is evaluated. If all ` if` and ` else if` conditions evaluate to
3142
3130
` false ` then any ` else ` block is executed.
3143
3131
3144
- ### ` match ` expressions
3132
+ ### Match expressions
3145
3133
3146
3134
A ` match ` expression branches on a * pattern* . The exact form of matching that
3147
3135
occurs depends on the pattern. Patterns consist of some combination of
@@ -3247,7 +3235,7 @@ let message = match maybe_digit {
3247
3235
};
3248
3236
```
3249
3237
3250
- ### ` if let` expressions
3238
+ ### If let expressions
3251
3239
3252
3240
An ` if let ` expression is semantically identical to an ` if ` expression but in place
3253
3241
of a condition expression it expects a refutable let statement. If the value of the
@@ -3268,15 +3256,15 @@ if let ("Ham", b) = dish {
3268
3256
}
3269
3257
```
3270
3258
3271
- ### ` while let` loops
3259
+ ### While let loops
3272
3260
3273
3261
A ` while let ` loop is semantically identical to a ` while ` loop but in place of a
3274
3262
condition expression it expects a refutable let statement. If the value of the
3275
3263
expression on the right hand side of the let statement matches the pattern, the
3276
3264
loop body block executes and control returns to the pattern matching statement.
3277
3265
Otherwise, the while expression completes.
3278
3266
3279
- ### ` return ` expressions
3267
+ ### Return expressions
3280
3268
3281
3269
Return expressions are denoted with the keyword ` return ` . Evaluating a ` return `
3282
3270
expression moves its argument into the designated output location for the
0 commit comments