bindgen std::convert::Infallible for empty tag unions

This commit is contained in:
Richard Feldman 2022-07-15 10:07:07 -04:00
parent 24df6ef93b
commit c4a3428b34
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798

View file

@ -1268,7 +1268,7 @@ fn add_struct<S: Display>(
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(),