From: Ralf Jung Date: Mon, 20 Aug 2018 18:08:37 +0000 (+0200) Subject: fix layout sanity check X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=f3e7efc8c17b920122de4a317ab788e2eb65f3ee;p=rust.git fix layout sanity check --- diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs index 4257c29bfee..df3dc44b229 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) } }