From 420d87e49b2f4d94b64d7b27572295d0f75ff072 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 27 Feb 2023 21:45:29 +0000 Subject: [PATCH] Ignore discriminants on enum variants While this loses the value information, its better than failing to generate bindings at all. --- c-bindings-gen/src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/c-bindings-gen/src/main.rs b/c-bindings-gen/src/main.rs index ee800db..ffd293f 100644 --- a/c-bindings-gen/src/main.rs +++ b/c-bindings-gen/src/main.rs @@ -1733,7 +1733,6 @@ fn writeln_enum<'a, 'b, W: std::io::Write>(w: &mut W, e: &'a syn::ItemEnum, type write!(w, ")").unwrap(); } } - if var.discriminant.is_some() { unimplemented!(); } write!(&mut constr, ") -> {} {{\n\t{}::{}", e.ident, e.ident, var.ident).unwrap(); if let syn::Fields::Named(fields) = &var.fields { writeln!(&mut constr, " {{").unwrap(); -- 2.39.5