TEST: Add test that ensures the MaybeUninit impl is used on nightly

This commit is contained in:
bluss
2018-12-16 10:46:38 +01:00
parent d395a01e7c
commit f0ec3e1398
2 changed files with 12 additions and 0 deletions
+9
View File
@@ -508,3 +508,12 @@ fn test_sizes_129_255() {
ArrayVec::from([0u8; 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::<ByteArray>() == 5);
}
}