Skip to content

Commit bc89539

Browse files
committed
transpile: don't handle bool as an integer type in fn CTypeKind::guaranteed_integer_in_range
1 parent 813e8e3 commit bc89539

File tree

1 file changed

+2
-1
lines changed
  • c2rust-transpile/src/c_ast

1 file changed

+2
-1
lines changed

c2rust-transpile/src/c_ast/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2202,7 +2202,8 @@ impl CTypeKind {
22022202
match *self {
22032203
Void => false,
22042204

2205-
Bool => (0..=1).contains(&value),
2205+
// Kind of an integer type, but would definitely need an explicit cast.
2206+
Bool => false,
22062207

22072208
// Can be signed or unsigned, so choose the minimum range of each.
22082209
Char => (u8::MIN as u64..=i8::MAX as u64).contains(&value),

0 commit comments

Comments
 (0)