From 4a2d54d07d6b7487d3292f6fd68dbf4a4cdf91ff Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 19 Mar 2020 09:47:48 +0100 Subject: [PATCH] add delay_span_bug to TransmuteSizeDiff, just to be sure --- src/librustc_mir/interpret/place.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustc_mir/interpret/place.rs b/src/librustc_mir/interpret/place.rs index 107cfee5aceb5..3d40b39f61c9c 100644 --- a/src/librustc_mir/interpret/place.rs +++ b/src/librustc_mir/interpret/place.rs @@ -926,6 +926,10 @@ where // most likey we *are* running `typeck` right now. Investigate whether we can bail out // on `typeck_tables().has_errors` at all const eval entry points. debug!("Size mismatch when transmuting!\nsrc: {:#?}\ndest: {:#?}", src, dest); + self.tcx.sess.delay_span_bug( + self.tcx.span, + "size-changing transmute, should have been caught by transmute checking", + ); throw_inval!(TransmuteSizeDiff(src.layout.ty, dest.layout.ty)); } // Unsized copies rely on interpreting `src.meta` with `dest.layout`, we want