Skip to content

Commit 30e17e3

Browse files
committed
Fix panic on unaligned packed attribute
1 parent 5945709 commit 30e17e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/hir-def/src/data/adt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn parse_repr_tt(tt: &Subtree) -> Option<ReprOptions> {
128128
} else {
129129
0
130130
};
131-
let pack = Align::from_bytes(pack).unwrap();
131+
let pack = Align::from_bytes(pack).unwrap_or(Align::ONE);
132132
min_pack =
133133
Some(if let Some(min_pack) = min_pack { min_pack.min(pack) } else { pack });
134134
ReprFlags::empty()

0 commit comments

Comments
 (0)