diff --git a/crates/header-translator/src/id.rs b/crates/header-translator/src/id.rs index f4bd7bbb3..cec7ef7e3 100644 --- a/crates/header-translator/src/id.rs +++ b/crates/header-translator/src/id.rs @@ -186,7 +186,11 @@ impl Location { } pub fn assert_file(&self, file_name: &str) { - assert_eq!(self.file_name(), Some(file_name)); + assert_eq!( + self.file_name(), + Some(file_name), + "expected {self:?} to be in {file_name:?}" + ); } } diff --git a/crates/header-translator/src/rust_type.rs b/crates/header-translator/src/rust_type.rs index 394fc27f0..f8e6b4e49 100644 --- a/crates/header-translator/src/rust_type.rs +++ b/crates/header-translator/src/rust_type.rs @@ -1725,7 +1725,8 @@ impl Ty { FormatterFn(move |f| match self { Self::Primitive(Primitive::NSInteger) => write!(f, "#[repr(isize)] // NSInteger"), Self::Primitive(Primitive::NSUInteger) => write!(f, "#[repr(usize)] // NSUInteger"), - _ => panic!("invalid closed enum repr"), + Self::Primitive(Primitive::U32) => write!(f, "#[repr(u32)]"), + _ => panic!("invalid closed enum repr: {self:?}"), }) } diff --git a/crates/header-translator/src/stmt.rs b/crates/header-translator/src/stmt.rs index f0aa7b67e..6c6670f64 100644 --- a/crates/header-translator/src/stmt.rs +++ b/crates/header-translator/src/stmt.rs @@ -539,7 +539,12 @@ fn parse_fn_param_children(entity: &Entity<'_>, context: &Context<'_>) { immediate_children(entity, |entity, _span| match entity.get_kind() { EntityKind::UnexposedAttr => { if let Some(attr) = UnexposedAttr::parse(&entity, context) { - error!(?attr, "unknown attribute on fn param"); + match attr { + UnexposedAttr::NoEscape => { + // TODO: Use this if mapping `fn + context ptr` to closure. + } + _ => error!(?attr, "unknown attribute on fn param"), + } } } EntityKind::ObjCClassRef