From 93220e55ae1a20e6d65db1575635946c816ac351 Mon Sep 17 00:00:00 2001 From: bluss Date: Wed, 10 Jul 2019 16:57:48 +0200 Subject: [PATCH] TEST: Update tests for new MaybeUninit usage (Also remove the size check since we can't rely on it, even if we want to ensure it has no overhead for the bytes case.) --- .travis.yml | 5 +++-- tests/tests.rs | 8 +++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3730670..c02af70 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ matrix: - rust: stable env: - FEATURES='array-sizes-33-128 array-sizes-129-255' + - ARRAYVECTEST_ENSURE_MAYBEUNINIT=1 - rust: beta - rust: nightly env: @@ -23,12 +24,12 @@ matrix: - rust: nightly env: - NODROP_FEATURES='use_needs_drop' - - ARRAYVECTEST_ENSURE_UNION=1 + - ARRAYVECTEST_ENSURE_MAYBEUNINIT=1 - rust: nightly env: - FEATURES='serde use_union' - NODROP_FEATURES='use_union' - - ARRAYVECTEST_ENSURE_UNION=1 + - ARRAYVECTEST_ENSURE_MAYBEUNINIT=1 branches: only: - master diff --git a/tests/tests.rs b/tests/tests.rs index 0e69467..b8dbadb 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -510,10 +510,8 @@ fn test_sizes_129_255() { #[test] -fn test_nightly_uses_maybe_uninit() { - if option_env!("ARRAYVECTEST_ENSURE_UNION").map(|s| !s.is_empty()).unwrap_or(false) { - assert!(cfg!(has_manually_drop_in_union)); - type ByteArray = ArrayVec<[u8; 4]>; - assert!(mem::size_of::() == 5); +fn test_newish_stable_uses_maybe_uninit() { + if option_env!("ARRAYVECTEST_ENSURE_MAYBEUNINIT").map(|s| !s.is_empty()).unwrap_or(false) { + assert!(cfg!(has_stable_maybe_uninit)); } }