Skip to content

Commit 1a2093d

Browse files
committed
Unify and nest structs and enums
Another alternative to RFC rust-lang#5 and an extension/variant of RFC rust-lang#11. Unify enums and structs by allowing enums to have fields, and structs to have variants. Allow nested enums/structs. Virtual dispatch of methods on struct/enum pointers. Remove struct variants. Treat enum variants as first class. Possibly remove nullary structs and tuple structs.
1 parent a260073 commit 1a2093d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

0000-enum-struct.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
- Start Date: (fill me in with today's date, YYY-MM-DD)
2+
- RFC PR #: (leave this empty)
3+
- Rust Issue #: (leave this empty)
4+
5+
# Summary
6+
7+
One para explanation of the feature.
8+
9+
# Motivation
10+
11+
Why are we doing this? What use cases does it support? What is the expected outcome?
12+
13+
# Detailed design
14+
15+
This is the bulk of the RFC. Explain the design in enough detail for somebody familiar
16+
with the language to understand, and for somebody familiar with the compiler to implement.
17+
This should get into specifics and corner-cases, and include examples of how the feature is used.
18+
19+
# Alternatives
20+
21+
What other designs have been considered? What is the impact of not doing this?
22+
23+
# Unresolved questions
24+
25+
What parts of the design are still TBD?

0 commit comments

Comments
 (0)