]> git.lizzy.rs Git - rust.git/commitdiff
add delay_span_bug to TransmuteSizeDiff, just to be sure
authorRalf Jung <post@ralfj.de>
Thu, 19 Mar 2020 08:47:48 +0000 (09:47 +0100)
committerRalf Jung <post@ralfj.de>
Thu, 19 Mar 2020 09:40:48 +0000 (10:40 +0100)
src/librustc_mir/interpret/place.rs

index 107cfee5aceb50f6b3ecb21887ee8e82de138a8b..3d40b39f61c9c9b5408cd24171d46c431745135f 100644 (file)
@@ -926,6 +926,10 @@ pub fn copy_op_transmute(
             // 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