when -Zrandomize-layout is enabled disable alloc test testing internal struct sizes
This commit is contained in:
parent
5bf8eeb9f3
commit
e3169f76e6
@ -52,4 +52,5 @@ check-cfg = [
|
|||||||
'cfg(no_global_oom_handling)',
|
'cfg(no_global_oom_handling)',
|
||||||
'cfg(no_rc)',
|
'cfg(no_rc)',
|
||||||
'cfg(no_sync)',
|
'cfg(no_sync)',
|
||||||
|
'cfg(randomized_layouts)',
|
||||||
]
|
]
|
||||||
|
@ -90,7 +90,7 @@ fn test_partial_eq() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
#[cfg_attr(miri, ignore)] // We'd like to run Miri with layout randomization
|
#[cfg_attr(any(miri, randomized_layouts), ignore)] // We'd like to run Miri with layout randomization
|
||||||
fn test_sizes() {
|
fn test_sizes() {
|
||||||
assert_eq!(core::mem::size_of::<LeafNode<(), ()>>(), 16);
|
assert_eq!(core::mem::size_of::<LeafNode<(), ()>>(), 16);
|
||||||
assert_eq!(core::mem::size_of::<LeafNode<i64, i64>>(), 16 + CAPACITY * 2 * 8);
|
assert_eq!(core::mem::size_of::<LeafNode<i64, i64>>(), 16 + CAPACITY * 2 * 8);
|
||||||
|
@ -2193,6 +2193,9 @@ impl<'a> Builder<'a> {
|
|||||||
rustflags.arg("-Zvalidate-mir");
|
rustflags.arg("-Zvalidate-mir");
|
||||||
rustflags.arg(&format!("-Zmir-opt-level={mir_opt_level}"));
|
rustflags.arg(&format!("-Zmir-opt-level={mir_opt_level}"));
|
||||||
}
|
}
|
||||||
|
if self.config.rust_randomize_layout {
|
||||||
|
rustflags.arg("--cfg=randomized_layouts");
|
||||||
|
}
|
||||||
// Always enable inlining MIR when building the standard library.
|
// Always enable inlining MIR when building the standard library.
|
||||||
// Without this flag, MIR inlining is disabled when incremental compilation is enabled.
|
// Without this flag, MIR inlining is disabled when incremental compilation is enabled.
|
||||||
// That causes some mir-opt tests which inline functions from the standard library to
|
// That causes some mir-opt tests which inline functions from the standard library to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user