https://github.com/restioson/blair_mountain
A macro to define union types with union semantics in release mode but debug assertions in debug mode
https://github.com/restioson/blair_mountain
Last synced: about 1 year ago
JSON representation
A macro to define union types with union semantics in release mode but debug assertions in debug mode
- Host: GitHub
- URL: https://github.com/restioson/blair_mountain
- Owner: Restioson
- License: mpl-2.0
- Created: 2020-02-21T18:19:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-23T17:44:05.000Z (over 6 years ago)
- Last Synced: 2025-03-10T06:06:27.725Z (over 1 year ago)
- Language: Rust
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# blair_mountain
A crate that exports one macro (`union`) to create types that are enums with checks in debug mode, but unions in release mode. In debug mode, invalid access will panic, while in release
they will not. It is therefore unsafe. Fields should be treated as fields of unions (i.e
no non-`Copy` types allowed, etc). **Please test all code generated with `blair_mountain` in
both release and debug modes.**