Skip to content

Commit 6a82da5

Browse files
committed
allow empty structs
1 parent 778ddd9 commit 6a82da5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

active/0000-structs.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
- Start Date: 2014-06-30
2+
- RFC PR #: (leave this empty)
3+
- Rust Issue #: (leave this empty)
4+
5+
# Summary
6+
7+
Allow empty structs with braces.
8+
9+
# Motivation
10+
11+
`struct X;` is an exception that was necessary because of ambiguous code such as `if x == X { } { ... }`.
12+
With [this PR](https://github.com/rust-lang/rust/pull/14885) the ambiguity no longer exists.
13+
14+
# Detailed design
15+
16+
Allow `struct X { }`.
17+
Remove or keep `struct X;`.
18+
Some people might want to keep `let x = X;`.
19+
20+
# Drawbacks
21+
22+
None that I know of.
23+
24+
# Alternatives
25+
26+
N/A
27+
28+
# Unresolved questions
29+
30+
None that I know of.

0 commit comments

Comments
 (0)