Skip to content

Commit

Permalink
Rollup merge of rust-lang#70139 - RalfJung:delay, r=eddyb
Browse files Browse the repository at this point in the history
add delay_span_bug to TransmuteSizeDiff, just to be sure

See rust-lang#69839 (comment).

r? @eddyb
  • Loading branch information
Centril authored Mar 21, 2020
2 parents 79cb6b9 + 4a2d54d commit f468f9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc_mir/interpret/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f468f9b

Please sign in to comment.