mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
fix layout sanity check
This commit is contained in:
parent
128c634c7f
commit
f3e7efc8c1
@ -199,7 +199,12 @@ fn from_known_layout<'tcx>(
|
||||
match layout {
|
||||
None => compute(),
|
||||
Some(layout) => {
|
||||
debug_assert_eq!(layout.ty, compute()?.ty);
|
||||
if cfg!(debug_assertions) {
|
||||
let layout2 = compute()?;
|
||||
assert_eq!(layout.details, layout2.details,
|
||||
"Mismatch in layout of supposedly equal-layout types {:?} and {:?}",
|
||||
layout.ty, layout2.ty);
|
||||
}
|
||||
Ok(layout)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user