Skip to content

Commit 25891c8

Browse files
authored
Rollup merge of rust-lang#101339 - the8472:ci-randomize-debug, r=Mark-Simulacrum
enable -Zrandomize-layout in debug CI builds This builds rustc/libs/tools with `-Zrandomize-layout` on *-debug CI runners. Only a handful of tests and asserts break with that enabled, which is promising. One test was fixable, the rest is dealt with by disabling them through new cargo features or compiletest directives. The config.toml flag `rust.randomize-layout` defaults to false, so it has to be explicitly enabled for now.
2 parents fee6300 + 64c1db2 commit 25891c8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: alloc/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@ check-cfg = [
5252
'cfg(no_global_oom_handling)',
5353
'cfg(no_rc)',
5454
'cfg(no_sync)',
55+
'cfg(randomized_layouts)',
5556
]

Diff for: alloc/src/collections/btree/node/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn test_partial_eq() {
9090

9191
#[test]
9292
#[cfg(target_arch = "x86_64")]
93-
#[cfg_attr(miri, ignore)] // We'd like to run Miri with layout randomization
93+
#[cfg_attr(any(miri, randomized_layouts), ignore)] // We'd like to run Miri with layout randomization
9494
fn test_sizes() {
9595
assert_eq!(core::mem::size_of::<LeafNode<(), ()>>(), 16);
9696
assert_eq!(core::mem::size_of::<LeafNode<i64, i64>>(), 16 + CAPACITY * 2 * 8);

0 commit comments

Comments
 (0)