From f3e7efc8c17b920122de4a317ab788e2eb65f3ee Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 20 Aug 2018 20:08:37 +0200 Subject: [PATCH] fix layout sanity check --- src/librustc_mir/interpret/operand.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs index 4257c29bfee1..df3dc44b2298 100644 --- a/src/librustc_mir/interpret/operand.rs +++ b/src/librustc_mir/interpret/operand.rs @@ -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) } }