From 9c7ce6656d67059c5db997e0b52c725fa3e70aea Mon Sep 17 00:00:00 2001 From: Khyber Sen Date: Sun, 30 Jul 2023 23:32:46 -0700 Subject: [PATCH] `c2rust transpile`: Allow any integral types in init lists, not just `char` and `int`. --- c2rust-transpile/src/translator/literals.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c2rust-transpile/src/translator/literals.rs b/c2rust-transpile/src/translator/literals.rs index d35fce2d4..d8eb64db6 100644 --- a/c2rust-transpile/src/translator/literals.rs +++ b/c2rust-transpile/src/translator/literals.rs @@ -249,7 +249,7 @@ impl<'c> Translation<'c> { CTypeKind::Vector(CQualTypeId { ctype, .. }, len) => { self.vector_list_initializer(ctx, ids, ctype, len) } - CTypeKind::Char | CTypeKind::Int => { + ref kind if kind.is_integral_type() => { let id = ids.first().unwrap(); self.convert_expr(ctx.used(), *id) }