File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2339,6 +2339,17 @@ impl CodeGenerator for CompInfo {
2339
2339
} else if is_union && !forward_decl {
2340
2340
// TODO(emilio): It'd be nice to unify this with the struct path
2341
2341
// above somehow.
2342
+ if layout. is_none ( ) {
2343
+ let location_option = item. location ( ) ;
2344
+ let error = match location_option {
2345
+ Some ( location) => format ! (
2346
+ "Unable to get layout information from: {location}"
2347
+ ) ,
2348
+ None => "Unable to get layout information or location"
2349
+ . to_string ( ) ,
2350
+ } ;
2351
+ panic ! ( "{}" , error) ;
2352
+ }
2342
2353
let layout = layout. expect ( "Unable to get layout information?" ) ;
2343
2354
if struct_layout. requires_explicit_align ( layout) {
2344
2355
explicit_align = Some ( layout. align ) ;
You can’t perform that action at this time.
0 commit comments