We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
TransmuteSizeDiff
1 parent 5b278bc commit efbbc69Copy full SHA for efbbc69
src/librustc_mir/interpret/place.rs
@@ -942,6 +942,10 @@ where
942
}
943
// We still require the sizes to match.
944
if src.layout.size != dest.layout.size {
945
+ // FIXME: This should be an assert instead of an error, but if we transmute within an
946
+ // array length computation, `typeck` may not have yet been run and errored out. In fact
947
+ // most likey we *are* running `typeck` right now. Investigate whether we can bail out
948
+ // on `typeck_tables().has_errors` at all const eval entry points.
949
error!("Size mismatch when transmuting!\nsrc: {:#?}\ndest: {:#?}", src, dest);
950
throw_unsup!(TransmuteSizeDiff(src.layout.ty, dest.layout.ty));
951
0 commit comments