]> git.lizzy.rs Git - rust.git/commitdiff
fix layout sanity check
authorRalf Jung <post@ralfj.de>
Mon, 20 Aug 2018 18:08:37 +0000 (20:08 +0200)
committerRalf Jung <post@ralfj.de>
Wed, 22 Aug 2018 11:08:40 +0000 (13:08 +0200)
src/librustc_mir/interpret/operand.rs

index 4257c29bfee1cca7b93dfd9d1113335f665da285..df3dc44b2298465344eaaacb9b3556232ccbfe5b 100644 (file)
@@ -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)
         }
     }