From 64c1db22d08a0454e1a62a3ae9b053f372f7f656 Mon Sep 17 00:00:00 2001 From: The 8472 Date: Fri, 2 Sep 2022 20:18:19 +0200 Subject: [PATCH] when -Zrandomize-layout is enabled disable alloc test testing internal struct sizes --- alloc/Cargo.toml | 1 + alloc/src/collections/btree/node/tests.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/alloc/Cargo.toml b/alloc/Cargo.toml index 4365bcc4ad022..1bd4434d4f7e9 100644 --- a/alloc/Cargo.toml +++ b/alloc/Cargo.toml @@ -52,4 +52,5 @@ check-cfg = [ 'cfg(no_global_oom_handling)', 'cfg(no_rc)', 'cfg(no_sync)', + 'cfg(randomized_layouts)', ] diff --git a/alloc/src/collections/btree/node/tests.rs b/alloc/src/collections/btree/node/tests.rs index d230749d71231..4d2fa0f094171 100644 --- a/alloc/src/collections/btree/node/tests.rs +++ b/alloc/src/collections/btree/node/tests.rs @@ -90,7 +90,7 @@ fn test_partial_eq() { #[test] #[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() { assert_eq!(core::mem::size_of::>(), 16); assert_eq!(core::mem::size_of::>(), 16 + CAPACITY * 2 * 8);