Skip to content

Commit 98dcfaf

Browse files
committed
transpile: support CastKind::BooleanToSignedIntegral
1 parent d0c85d0 commit 98dcfaf

File tree

1 file changed

+2
-6
lines changed
  • c2rust-transpile/src/translator

1 file changed

+2
-6
lines changed

c2rust-transpile/src/translator/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4414,7 +4414,8 @@ impl<'c> Translation<'c> {
44144414
| CastKind::IntegralCast
44154415
| CastKind::FloatingCast
44164416
| CastKind::FloatingToIntegral
4417-
| CastKind::IntegralToFloating => {
4417+
| CastKind::IntegralToFloating
4418+
| CastKind::BooleanToSignedIntegral => {
44184419
let target_ty = self.convert_type(ty.ctype)?;
44194420
let target_ty_ctype = &self.ast_context.resolve_type(ty.ctype).kind;
44204421

@@ -4571,11 +4572,6 @@ impl<'c> Translation<'c> {
45714572
}
45724573
}
45734574

4574-
// I don't know how to actually cause clang to generate this
4575-
CastKind::BooleanToSignedIntegral => Err(TranslationError::generic(
4576-
"TODO boolean to signed integral not supported",
4577-
)),
4578-
45794575
CastKind::FloatingRealToComplex
45804576
| CastKind::FloatingComplexToIntegralComplex
45814577
| CastKind::FloatingComplexCast

0 commit comments

Comments
 (0)