diff --git a/Cargo.toml b/Cargo.toml index 248c041378..3892cb6203 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,7 +57,6 @@ cast_possible_truncation = "allow" cast_possible_wrap = "allow" cast_precision_loss = "allow" cast_sign_loss = "allow" -checked_conversions = "allow" default_trait_access = "allow" explicit_into_iter_loop = "allow" flat_map_option = "allow" diff --git a/bindgen/ir/var.rs b/bindgen/ir/var.rs index 4f61448fea..85e127fdbc 100644 --- a/bindgen/ir/var.rs +++ b/bindgen/ir/var.rs @@ -234,10 +234,7 @@ impl ClangSubItemParser for Var { assert_eq!(c.len_utf8(), 1); c as u8 } - CChar::Raw(c) => { - assert!(c <= u64::from(u8::MAX)); - c as u8 - } + CChar::Raw(c) => u8::try_from(c).unwrap(), }; (TypeKind::Int(IntKind::U8), VarType::Char(c))