Skip to content

Commit da99b54

Browse files
committed
update
1 parent 6a82da5 commit da99b54

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

active/0000-structs.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,27 @@ Allow empty structs with braces.
1111
`struct X;` is an exception that was necessary because of ambiguous code such as `if x == X { } { ... }`.
1212
With [this PR](https://github.com/rust-lang/rust/pull/14885) the ambiguity no longer exists.
1313

14+
## Definitive list of reasons to do this.
15+
16+
- 64% (or so) of those who voted want this (+1 vs. -1).
17+
- Macros without special cases for zero elements.
18+
- Ease the transition between empty and non-empty structs: `struct X { _sigh: () }`.
19+
- Consistency with C code. People find this weird when learning Rust.
20+
- Consistency with Rust code: `trait X { }`, `enum X { }`, `fn x() { }`, `mod X { }`.
21+
- Clarity: `let x = X { };` is a struct.
22+
1423
# Detailed design
1524

16-
Allow `struct X { }`.
17-
Remove or keep `struct X;`.
18-
Some people might want to keep `let x = X;`.
25+
Replace `;` by `{ }` everywhere.
1926

2027
# Drawbacks
2128

22-
None that I know of.
29+
None.
2330

2431
# Alternatives
2532

2633
N/A
2734

2835
# Unresolved questions
2936

30-
None that I know of.
37+
TIOOWTDI (with a majority in favor)

0 commit comments

Comments
 (0)