Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wafflelapkin/anon_enum
Demo of anonymous enums in Rust
https://github.com/wafflelapkin/anon_enum
Last synced: about 2 months ago
JSON representation
Demo of anonymous enums in Rust
- Host: GitHub
- URL: https://github.com/wafflelapkin/anon_enum
- Owner: WaffleLapkin
- License: mit
- Created: 2020-04-15T09:10:35.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-15T09:31:42.000Z (almost 5 years ago)
- Last Synced: 2024-12-04T07:33:54.359Z (about 2 months ago)
- Language: Rust
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Anonymous Enams Demo
Demo of anonymous enums. Demo is made for illustrating [**Anonymous Enums RFC (take 4)**][rfc].
This demo uses macros for making syntax proposed in the RFC possible (`Ae!` for types,
`ae!` for expressions and `ae_pat!` for patterns). If you'll remove all the macros from tests
that should be compilable code under proposed `#![feature(anonymous_enums)]`.**Note**: apart from the RFC, this crate uses `Either` + `Never` in a hlist-like way, so it's
capable of implementing traits on enums of any size. However with `anonymous_enums` in the
compiler that would require additional feature and thus explicitly left out from the RFC.Also this demo supports one variant (`Ae![T]`, `ae!(::0(t))`, `ae_pat!(::0(_))`) and empty
enums (`Ae![]`), both of which are in "Unresolved questions" section in the RFC.[rfc]: https://github.com/WaffleLapkin/rfcs/blob/anonymous-enums/text/0000-anonymous-enums.md