TEST: Add test that ensures the MaybeUninit impl is used on nightly
This commit is contained in:
@@ -19,13 +19,16 @@ matrix:
|
|||||||
- rust: nightly
|
- rust: nightly
|
||||||
env:
|
env:
|
||||||
- NODEFAULT=1
|
- NODEFAULT=1
|
||||||
|
- ARRAYVECTEST_ENSURE_UNION=1
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env:
|
env:
|
||||||
- NODROP_FEATURES='use_needs_drop'
|
- NODROP_FEATURES='use_needs_drop'
|
||||||
|
- ARRAYVECTEST_ENSURE_UNION=1
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env:
|
env:
|
||||||
- FEATURES='serde use_union'
|
- FEATURES='serde use_union'
|
||||||
- NODROP_FEATURES='use_union'
|
- NODROP_FEATURES='use_union'
|
||||||
|
- ARRAYVECTEST_ENSURE_UNION=1
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|||||||
@@ -508,3 +508,12 @@ fn test_sizes_129_255() {
|
|||||||
ArrayVec::from([0u8; 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user