Rollup merge of #70139 - RalfJung:delay, r=eddyb

add delay_span_bug to TransmuteSizeDiff, just to be sure

See https://github.com/rust-lang/rust/pull/69839#discussion_r394858464.

r? @eddyb
This commit is contained in:
Mazdak Farrokhzad 2020-03-21 05:33:23 +01:00 committed by GitHub
commit c4a5cc1671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -920,6 +920,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