Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mahkoh committed Aug 5, 2014
1 parent 6a82da5 commit da99b54
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions active/0000-structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,27 @@ Allow empty structs with braces.
`struct X;` is an exception that was necessary because of ambiguous code such as `if x == X { } { ... }`.
With [this PR](https://github.com/rust-lang/rust/pull/14885) the ambiguity no longer exists.

## Definitive list of reasons to do this.

- 64% (or so) of those who voted want this (+1 vs. -1).
- Macros without special cases for zero elements.
- Ease the transition between empty and non-empty structs: `struct X { _sigh: () }`.
- Consistency with C code. People find this weird when learning Rust.
- Consistency with Rust code: `trait X { }`, `enum X { }`, `fn x() { }`, `mod X { }`.
- Clarity: `let x = X { };` is a struct.

# Detailed design

Allow `struct X { }`.
Remove or keep `struct X;`.
Some people might want to keep `let x = X;`.
Replace `;` by `{ }` everywhere.

# Drawbacks

None that I know of.
None.

# Alternatives

N/A

# Unresolved questions

None that I know of.
TIOOWTDI (with a majority in favor)

0 comments on commit da99b54

Please sign in to comment.