fix failure to detect a too-big-type after adding padding
This commit is contained in:
parent
707d8c3f1b
commit
2ef5897a89
4 changed files with 34 additions and 0 deletions
|
@ -19,6 +19,9 @@ pub(super) fn sanity_check_layout<'tcx>(
|
|||
if layout.size.bytes() % layout.align.abi.bytes() != 0 {
|
||||
bug!("size is not a multiple of align, in the following layout:\n{layout:#?}");
|
||||
}
|
||||
if layout.size.bytes() >= cx.tcx.data_layout.obj_size_bound() {
|
||||
bug!("size is too large, in the following layout:\n{layout:#?}");
|
||||
}
|
||||
|
||||
if !cfg!(debug_assertions) {
|
||||
// Stop here, the rest is kind of expensive.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue