Skip to content

Commit c0b2470

Browse files
committed
Log item for which layout retrieval fails
1 parent 66b6551 commit c0b2470

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bindgen/codegen/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,9 @@ impl CodeGenerator for CompInfo {
22162216
} else if is_union && !forward_decl {
22172217
// TODO(emilio): It'd be nice to unify this with the struct path
22182218
// above somehow.
2219-
let layout = layout.expect("Unable to get layout information?");
2219+
let layout = layout.unwrap_or_else(|| {
2220+
panic!("Unable to get layout information for item\n{:#?}", item)
2221+
});
22202222
if struct_layout.requires_explicit_align(layout) {
22212223
explicit_align = Some(layout.align);
22222224
}

0 commit comments

Comments
 (0)