-
Notifications
You must be signed in to change notification settings - Fork 232
Closed
Description
enum ErlNifCharEncoding has the DUMMY variant to prevent a "univariant enum" compile error from happening.
rustler/rustler_sys/src/rustler_sys_api.rs
Lines 185 to 191 in b1e09e2
| /// See [ErlNifCharEncoding](http://www.erlang.org/doc/man/erl_nif.html#ErlNifCharEncoding) in the Erlang docs. | |
| #[derive(Debug, Copy, Clone)] | |
| #[repr(C)] | |
| pub enum ErlNifCharEncoding { | |
| ERL_NIF_LATIN1 = 1, | |
| DUMMY = 999, // prevents "univariant enum" compile error | |
| } |
But this enum without this DUMMY variant no longer emits a compile error with the latest stable release of rustc.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ee80075ae7081fe3e634f8cb402e45df
I believe that this "univariant enum" issue was fixed in rust-lang/rust#33355, which landed in rustc 1.10.0 (2016-07-07). Maybe we can mark the DUMMY variant as deprecated and remove it in the next release.
evnu
Metadata
Metadata
Assignees
Labels
No labels