From c4a3428b34f487ba6f9cf4be1cb7f4f60a7cde1c Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Fri, 15 Jul 2022 10:07:07 -0400 Subject: [PATCH] bindgen std::convert::Infallible for empty tag unions --- crates/bindgen/src/bindgen_rs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bindgen/src/bindgen_rs.rs b/crates/bindgen/src/bindgen_rs.rs index a5d22659c9..fe7eaf2f56 100644 --- a/crates/bindgen/src/bindgen_rs.rs +++ b/crates/bindgen/src/bindgen_rs.rs @@ -1268,7 +1268,7 @@ fn add_struct( fn type_name(id: TypeId, types: &Types) -> String { match types.get_type(id) { RocType::Unit => "()".to_string(), - RocType::EmptyTagUnion => "()".to_string(), // In the future, this can be `!` - https://doc.rust-lang.org/std/primitive.never.html + RocType::EmptyTagUnion => "std::convert::Infallible".to_string(), RocType::RocStr => "roc_std::RocStr".to_string(), RocType::Bool => "bool".to_string(), RocType::Num(RocNum::U8) => "u8".to_string(),