diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-09-18 13:36:45 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-09-18 15:28:01 +0300 |
| commit | 1eb42f1c784e999259b15f68c63040e1fafbe273 (patch) | |
| tree | 0d7722dbc2f279acb1455a052589e88adfd42df6 /src/doc/reference.md | |
| parent | 605a4729481db73473dc37f09f840da6ec6173ab (diff) | |
| download | rust-1eb42f1c784e999259b15f68c63040e1fafbe273.tar.gz rust-1eb42f1c784e999259b15f68c63040e1fafbe273.zip | |
Add feature gate
Diffstat (limited to 'src/doc/reference.md')
| -rw-r--r-- | src/doc/reference.md | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index 95a58686cf2..83849574260 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -1178,10 +1178,11 @@ let px: i32 = match p { Point(x, _) => x }; ``` A _unit-like struct_ is a structure without any fields, defined by leaving off -the list of fields entirely. Such structure implicitly defines a constant of +the list of fields entirely. Such a structure implicitly defines a constant of its type with the same name. For example: ``` +# #![feature(braced_empty_structs)] struct Cookie; let c = [Cookie, Cookie {}, Cookie, Cookie {}]; ``` @@ -1189,6 +1190,7 @@ let c = [Cookie, Cookie {}, Cookie, Cookie {}]; is equivalent to ``` +# #![feature(braced_empty_structs)] struct Cookie {} const Cookie: Cookie = Cookie {}; let c = [Cookie, Cookie {}, Cookie, Cookie {}]; @@ -2420,6 +2422,7 @@ The currently implemented features of the reference compiler are: terms of encapsulation). * - `default_type_parameter_fallback` - Allows type parameter defaults to influence type inference. +* - `braced_empty_structs` - Allows use of empty structs with braces. If a feature is promoted to a language feature, then all existing programs will start to receive compilation warnings about `#![feature]` directives which enabled |
