Add the transmute and asm checks to typeck as deferred checks
This commit is contained in:
parent
0fdaaadb36
commit
0d88631059
38 changed files with 678 additions and 364 deletions
|
@ -910,12 +910,12 @@ where
|
|||
// array length computation, `typeck` may not have yet been run and errored out. In fact
|
||||
// most likely we *are* running `typeck` right now. Investigate whether we can bail out
|
||||
// on `typeck_results().has_errors` at all const eval entry points.
|
||||
debug!("Size mismatch when transmuting!\nsrc: {:#?}\ndest: {:#?}", src, dest);
|
||||
self.tcx.sess.delay_span_bug(
|
||||
span_bug!(
|
||||
self.cur_span(),
|
||||
"size-changing transmute, should have been caught by transmute checking",
|
||||
"size-changing transmute, should have been caught by transmute checking: {:#?}\ndest: {:#?}",
|
||||
src,
|
||||
dest
|
||||
);
|
||||
throw_inval!(TransmuteSizeDiff(src.layout.ty, dest.layout.ty));
|
||||
}
|
||||
// Unsized copies rely on interpreting `src.meta` with `dest.layout`, we want
|
||||
// to avoid that here.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue