Skip to content

Commit f3e7efc

Browse files
committed
fix layout sanity check
1 parent 128c634 commit f3e7efc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc_mir/interpret/operand.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,12 @@ fn from_known_layout<'tcx>(
199199
match layout {
200200
None => compute(),
201201
Some(layout) => {
202-
debug_assert_eq!(layout.ty, compute()?.ty);
202+
if cfg!(debug_assertions) {
203+
let layout2 = compute()?;
204+
assert_eq!(layout.details, layout2.details,
205+
"Mismatch in layout of supposedly equal-layout types {:?} and {:?}",
206+
layout.ty, layout2.ty);
207+
}
203208
Ok(layout)
204209
}
205210
}

0 commit comments

Comments
 (0)